├── pkgs ├── stderred │ ├── .gitignore │ ├── Cargo.toml │ ├── default.nix │ └── src │ │ └── main.rs ├── python-wrapped │ ├── go.mod │ ├── default.nix │ └── main.go ├── bundle-image-tarball │ ├── builder.sh │ └── default.nix ├── modules │ ├── docker │ │ ├── etc │ │ │ ├── containerd.toml │ │ │ ├── buildkitd.toml │ │ │ └── dockerd.json │ │ ├── replit-buildkit.patch │ │ ├── default.nix │ │ ├── replit-shim-runc.patch │ │ ├── replit-containerd.patch │ │ └── replit-moby.patch │ ├── postgresql │ │ └── default.nix │ ├── nix │ │ └── default.nix │ ├── replit-rtld-loader │ │ └── default.nix │ ├── gcloud │ │ └── default.nix │ ├── pyright-extended │ │ └── default.nix │ ├── run-package-json │ │ ├── default.nix │ │ └── script.js │ ├── pyright │ │ └── default.nix │ ├── bash │ │ └── default.nix │ ├── python │ │ ├── sitecustomize.nix │ │ ├── pip.nix │ │ ├── sitecustomize.py │ │ ├── uv │ │ │ └── default.nix │ │ └── default.nix │ ├── clojure │ │ └── default.nix │ ├── lua │ │ └── default.nix │ ├── ruff │ │ └── default.nix │ ├── qbasic │ │ └── default.nix │ ├── R │ │ └── default.nix │ ├── deno │ │ └── default.nix │ ├── elixir │ │ └── default.nix │ ├── dart │ │ └── default.nix │ ├── typescript-language-server │ │ └── default.nix │ ├── svelte-kit │ │ └── default.nix │ ├── php │ │ └── default.nix │ ├── haskell │ │ └── default.nix │ ├── hermit │ │ └── default.nix │ ├── swift │ │ └── default.nix │ ├── dotnet │ │ └── default.nix │ ├── nodejs-with-prybar │ │ └── default.nix │ ├── bun │ │ └── default.nix │ ├── vue │ │ └── default.nix │ ├── replit │ │ └── default.nix │ ├── cpp │ │ └── default.nix │ ├── angular │ │ └── default.nix │ ├── ruby │ │ └── default.nix │ ├── python-with-prybar │ │ └── default.nix │ ├── python-base │ │ └── default.nix │ ├── go │ │ └── default.nix │ ├── rust │ │ └── default.nix │ ├── c │ │ └── default.nix │ ├── java │ │ └── default.nix │ ├── web │ │ └── default.nix │ ├── nodejs │ │ └── default.nix │ └── default.nix ├── bun │ └── default.nix ├── poetry │ ├── poetry-py3.12.nix │ ├── poetry-py3.9.nix │ ├── poetry-py3.10.nix │ ├── poetry-py3.11.nix │ ├── poetry-in-venv.nix │ └── README.md ├── replbox │ ├── default.nix │ ├── package.json │ ├── yarn.lock │ └── yarn.nix ├── moduleit │ ├── default.nix │ ├── README.md │ ├── entrypoint.nix │ ├── moduleit.sh │ └── example.nix ├── java-debug │ ├── patches │ │ └── repo.diff │ ├── repo.nix │ ├── default.nix │ ├── debug-plugin.nix │ └── java-dap ├── bundle-image │ ├── builder.sh │ └── default.nix ├── angular-language-server │ └── default.nix ├── vue-language-server │ └── default.nix ├── dapPython │ ├── default.nix │ └── wrapper.py ├── mk-phony-oci │ ├── default.nix │ └── builder.sh ├── mk-phony-ocis │ └── default.nix ├── pyright-extended │ └── default.nix ├── bundle │ └── default.nix ├── dap-cpp │ ├── default.nix │ └── messages.nix ├── upgrade-map │ └── default.nix ├── python-lsp-server │ └── default.nix ├── clang-compile │ └── default.nix ├── default.nix ├── python-utils │ └── default.nix ├── jdt-language-server │ └── default.nix ├── formatter │ └── default.nix └── historical-modules │ └── default.nix ├── .github ├── CODEOWNERS ├── workflows │ ├── checks.yml │ └── update-weekly.yml └── pull_request_template.md ├── .gitignore ├── replit.nix ├── .replit ├── scripts ├── moduleit_test.sh └── ci_check.sh ├── patches └── rexml.patch ├── LICENSE ├── README.md └── flake.nix /pkgs/stderred/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @replit/nixmodules-reviewers -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | build 3 | .envrc 4 | .direnv 5 | .netrc 6 | nix_build_cache_signing_key -------------------------------------------------------------------------------- /pkgs/python-wrapped/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/replit/python-wrapper 2 | 3 | go 1.21.9 4 | -------------------------------------------------------------------------------- /replit.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | deps = [ 3 | pkgs.unixtools.xxd 4 | pkgs.jq 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /.replit: -------------------------------------------------------------------------------- 1 | entrypoint = "pkgs/default.nix" 2 | modules = [] 3 | 4 | [env] 5 | HISTFILE = "$REPL_HOME/.cache/.bash_history" 6 | 7 | [nix] 8 | channel = "stable-23_11" 9 | -------------------------------------------------------------------------------- /pkgs/bundle-image-tarball/builder.sh: -------------------------------------------------------------------------------- 1 | . .attrs.sh 2 | 3 | PATH="${env[PATH]}" 4 | out="${outputs[out]}" 5 | bundleImage="${env[bundle-image]}" 6 | 7 | echo "making tarball..." 8 | mkdir -p "$out" 9 | tar --use-compress-program=pigz -Scf $out/disk.raw.tar.gz -C ${bundleImage} disk.raw 10 | -------------------------------------------------------------------------------- /pkgs/modules/docker/etc/containerd.toml: -------------------------------------------------------------------------------- 1 | version = 2 2 | root = "" # Set in the commandline 3 | state = "/run/containerd" 4 | 5 | [grpc] 6 | address = "/run/containerd/containerd.sock" 7 | uid = 1000 8 | gid = 1000 9 | max_recv_message_size = 16777216 10 | max_send_message_size = 16777216 11 | -------------------------------------------------------------------------------- /pkgs/bun/default.nix: -------------------------------------------------------------------------------- 1 | { bun 2 | , fetchurl 3 | }: 4 | 5 | bun.overrideAttrs rec { 6 | version = "1.2.16"; 7 | src = fetchurl { 8 | url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-x64.zip"; 9 | hash = "sha256-+DEdjXyqDZOMbEzs8KYA5enOTidaQR44oun4x30MEAI="; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/modules/docker/etc/buildkitd.toml: -------------------------------------------------------------------------------- 1 | [worker.oci] 2 | enabled = false 3 | 4 | [worker.containerd] 5 | enabled = true 6 | namespace = "buildkit" 7 | platforms = ["linux/amd64", "linux/amd64/v2", "linux/amd64/v3"] 8 | 9 | [worker.containerd.runtime] 10 | name = "@replitShimRunc@/bin/replit-shim-runc" 11 | -------------------------------------------------------------------------------- /pkgs/poetry/poetry-py3.12.nix: -------------------------------------------------------------------------------- 1 | { pkgs, python, pypkgs }: 2 | pkgs.callPackage ./poetry-in-venv.nix { 3 | version = "1.5.6"; 4 | url = https://storage.googleapis.com/poetry-bundles/poetry-1.5.6-python-3.12.7-bundle.tgz; 5 | sha256 = "sha256:1v42fgq3p5g41l5al33fswrx4g335gf1jxadvdf378giy583r309"; 6 | inherit python pypkgs; 7 | } 8 | -------------------------------------------------------------------------------- /pkgs/poetry/poetry-py3.9.nix: -------------------------------------------------------------------------------- 1 | { pkgs, python, pypkgs }: 2 | pkgs.callPackage ./poetry-in-venv.nix { 3 | version = "1.5.4"; 4 | url = https://storage.googleapis.com/poetry-bundles/poetry-1.5.5-python-3.9.19-bundle.tgz; 5 | sha256 = "sha256:0gmkb35nqym09lshk5r51zhr2l609ag4aahqbh43pckqjqw80446"; 6 | inherit python pypkgs; 7 | } 8 | -------------------------------------------------------------------------------- /pkgs/poetry/poetry-py3.10.nix: -------------------------------------------------------------------------------- 1 | { pkgs, python, pypkgs }: 2 | pkgs.callPackage ./poetry-in-venv.nix { 3 | version = "1.5.6"; 4 | url = https://storage.googleapis.com/poetry-bundles/poetry-1.5.6-python-3.10.16-bundle.tgz; 5 | sha256 = "sha256:1bgdqyh7mvbpay47k5wni25vrx7j9f3g15bhcnws33vy2vyqyldc"; 6 | inherit python pypkgs; 7 | } 8 | -------------------------------------------------------------------------------- /pkgs/poetry/poetry-py3.11.nix: -------------------------------------------------------------------------------- 1 | { pkgs, python, pypkgs }: 2 | pkgs.callPackage ./poetry-in-venv.nix { 3 | version = "1.5.6"; 4 | url = https://storage.googleapis.com/poetry-bundles/poetry-1.5.6-python-3.11.10-bundle.tgz; 5 | sha256 = "sha256:139kfql4in5lc519q6bfby27jbfaixm4x1zdj778vm1hdd8ydn6k"; 6 | inherit python pypkgs; 7 | } 8 | -------------------------------------------------------------------------------- /scripts/moduleit_test.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | nixpkgs_rev=$(nix run --inputs-from . nixpkgs#jq -- -r '.nodes."nixpkgs-unstable".locked.rev' flake.lock) 4 | cd /tmp 5 | curl "https://github.com/nixos/nixpkgs/archive/${nixpkgs_rev}.tar.gz" -L -o nixpkgs.tar.gz 6 | tar xzf "nixpkgs.tar.gz" 7 | export NIX_PATH="nixpkgs-unstable=$PWD/nixpkgs-${nixpkgs_rev}" 8 | cd - 9 | cd pkgs/moduleit 10 | ./moduleit.sh example.nix -------------------------------------------------------------------------------- /pkgs/stderred/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "stderred" 3 | version = "0.1.0" 4 | authors = ["Replit"] 5 | edition = "2021" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | anyhow = "1.0" 11 | clap = { version = ">=4.0, <= 4.3.24", features = ["derive"] } 12 | itertools = "0.10" 13 | memmap = "0.7" 14 | nix = "0.23" 15 | xmas-elf = "0.10" 16 | -------------------------------------------------------------------------------- /pkgs/modules/postgresql/default.nix: -------------------------------------------------------------------------------- 1 | { postgresql }: 2 | { pkgs, lib, ... }: 3 | let 4 | postgresql-version = lib.versions.major postgresql.version; 5 | in 6 | { 7 | id = "postgresql-${postgresql-version}"; 8 | name = "Postgresql Tools"; 9 | displayVersion = postgresql-version; 10 | description = '' 11 | Tools for working with Postgresql databases. 12 | ''; 13 | 14 | replit.packages = [ 15 | postgresql 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /pkgs/modules/nix/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | id = "nix"; 3 | name = "Nix"; 4 | description = '' 5 | Nil: Nix language server 6 | ''; 7 | 8 | replit.dev.languageServers.nil = { 9 | name = "Nix Language Server (nil)"; 10 | language = "nix"; 11 | start = "${pkgs.nil}/bin/nil"; 12 | extensions = [ ".nix" ]; 13 | 14 | configuration.nil.formatting.command = [ "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" ]; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /.github/workflows/checks.yml: -------------------------------------------------------------------------------- 1 | name: checks 2 | run-name: Check for errors 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | jobs: 9 | checks: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | with: 14 | fetch-depth: 0 15 | - name: Install Nix 16 | uses: DeterminateSystems/nix-installer-action@main 17 | - run: scripts/ci_check.sh 18 | -------------------------------------------------------------------------------- /pkgs/modules/replit-rtld-loader/default.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, ... }: 2 | { 3 | id = "replit-rtld-loader"; 4 | name = "Replit RTLD Loader"; 5 | description = '' 6 | The Replit RTLD Loader allows dynamically loaded shared libraries (.so) to work seamlessly in Repls. 7 | ''; 8 | 9 | replit.env = { 10 | LD_AUDIT = "${pkgs.replit-rtld-loader}/rtld_loader.so"; 11 | GLIBC_TUNABLES = "glibc.rtld.optional_static_tls=10000"; 12 | }; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /pkgs/modules/docker/etc/dockerd.json: -------------------------------------------------------------------------------- 1 | { 2 | "default-runtime": "replit-shim-runc", 3 | "containerd": "/run/containerd/containerd.sock", 4 | "containerd-namespace": "moby", 5 | "init": false, 6 | "iptables": false, 7 | "runtimes": { 8 | "replit-shim-runc": { 9 | "runtimeType": "@replitShimRunc@/bin/replit-shim-runc" 10 | } 11 | }, 12 | "features": { 13 | "containerd-snapshotter": true, 14 | "buildkit": false 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pkgs/replbox/default.nix: -------------------------------------------------------------------------------- 1 | { mkYarnPackage 2 | , fetchFromGitHub 3 | }: 4 | mkYarnPackage rec { 5 | name = "replbox"; 6 | version = "0.0.1"; 7 | 8 | src = fetchFromGitHub { 9 | owner = "replit"; 10 | repo = "replbox"; 11 | rev = "7f7873f2f2181ed0368aa6709218e06a4af3cc51"; 12 | sha256 = "0bhm31rr9l2kgc44m6s2583h2ql3bg5dzham6zrxlmkfms82rg63"; 13 | }; 14 | 15 | packageJSON = ./package.json; 16 | yarnLock = ./yarn.lock; 17 | yarnNix = ./yarn.nix; 18 | } 19 | -------------------------------------------------------------------------------- /pkgs/bundle-image-tarball/default.nix: -------------------------------------------------------------------------------- 1 | { system, bash, lib, bundle-image, revstring, coreutils, gnutar, pigz }: 2 | 3 | derivation { 4 | name = "nixmodules-${revstring}"; 5 | builder = "${bash}/bin/bash"; 6 | args = [ ./builder.sh ]; 7 | inherit system; 8 | __structuredAttrs = true; 9 | unsafeDiscardReferences.out = true; 10 | env = { 11 | PATH = lib.makeBinPath [ 12 | coreutils 13 | gnutar 14 | pigz 15 | ]; 16 | inherit bundle-image; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /pkgs/modules/gcloud/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | id = "gcloud"; 4 | name = "Google Cloud Tools"; 5 | displayVersion = pkgs.lib.versions.majorMinor pkgs.google-cloud-sdk.version; 6 | description = '' 7 | Google Cloud developer tools: 8 | All of the tools developers and development teams need to be productive 9 | when writing, deploying, and debugging applications hosted in Google Cloud. 10 | ''; 11 | replit.packages = [ 12 | pkgs.google-cloud-sdk 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/moduleit/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, stdenv, coreutils, runtimeShell }: 2 | stdenv.mkDerivation { 3 | name = "moduleit"; 4 | version = "2.0"; 5 | src = ./.; 6 | 7 | installPhase = '' 8 | mkdir $out 9 | cp entrypoint.nix $out/ 10 | cp module-definition.nix $out/ 11 | cp moduleit.sh $out/ 12 | mkdir $out/bin 13 | cat< $out/bin/moduleit 14 | #!${runtimeShell} 15 | ${runtimeShell} $out/moduleit.sh "\$@" 16 | EOF 17 | chmod u+x $out/bin/moduleit 18 | ''; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/java-debug/patches/repo.diff: -------------------------------------------------------------------------------- 1 | diff --git a/pom.xml b/pom.xml 2 | index 4f7abb1..89e48e5 100644 3 | --- a/pom.xml 4 | +++ b/pom.xml 5 | @@ -168,7 +168,7 @@ 6 | 7 | JDT.LS 8 | p2 9 | - https://download.eclipse.org/jdtls/snapshots/repository/latest/ 10 | + https://download.eclipse.org/jdtls/milestones/1.1.2/repository/ 11 | 12 | 13 | JBOLL.TOOLS 14 | -------------------------------------------------------------------------------- /pkgs/stderred/default.nix: -------------------------------------------------------------------------------- 1 | { rustPlatform 2 | , stderred 3 | , makeWrapper 4 | , 5 | }: 6 | 7 | rustPlatform.buildRustPackage { 8 | pname = "stderred"; 9 | version = "0.1.0"; 10 | 11 | src = builtins.path { 12 | path = ./.; 13 | name = "stderred"; 14 | }; 15 | 16 | cargoHash = "sha256-n6rGDpkkPwBB6BV97DXrL3NZnCa71YgAGXEI5bymbLw="; 17 | 18 | nativeBuildInputs = [ makeWrapper ]; 19 | 20 | postInstall = '' 21 | wrapProgram "$out/bin/stderred" \ 22 | --set STDERRED_PATH ${stderred}/lib/libstderred.so 23 | ''; 24 | } 25 | -------------------------------------------------------------------------------- /pkgs/bundle-image/builder.sh: -------------------------------------------------------------------------------- 1 | set -o xtrace 2 | . .attrs.sh 3 | 4 | PATH="${env[PATH]}" 5 | out="${outputs[out]}" 6 | 7 | mkdir "$out" 8 | 9 | root="$PWD/root" 10 | mkdir -p "$root/nix/store" "$root/etc/nixmodules" 11 | 12 | cp --archive --reflink=auto "${env["bundle"]}/etc/nixmodules/"* "$root/etc/nixmodules" 13 | 14 | xargs -I % cp -a --reflink=auto % "$root/nix/store/" < "${env[diskClosureInfo]}"/store-paths 15 | 16 | diskImage=$out/${env[diskName]} 17 | 18 | echo "making squashfs..." 19 | mksquashfs "$root" "$diskImage" -force-uid 11000 -force-gid 11000 20 | -------------------------------------------------------------------------------- /pkgs/modules/pyright-extended/default.nix: -------------------------------------------------------------------------------- 1 | { nodejs }: 2 | { pkgs, lib, ... }: 3 | let 4 | pyright-extended = pkgs.callPackage ../../pyright-extended { 5 | nodejs = nodejs; 6 | }; 7 | in 8 | { 9 | id = "pyright-extended"; 10 | name = "pyright-extended LSP"; 11 | displayVersion = pyright-extended.version; 12 | description = '' 13 | Pyright with yapf and ruff. 14 | ''; 15 | replit.languageServers.pyright-extended = { 16 | name = "pyright-extended"; 17 | language = "python3"; 18 | start = "${pyright-extended}/bin/langserver.index.js --stdio"; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/moduleit/README.md: -------------------------------------------------------------------------------- 1 | # ModuleIt 2 | 3 | A CLI tool for (Nix) module authors to compile modules. Preinstalled in repls. 4 | 5 | ## Usage 6 | 7 | Say you have a module such as `example.nix` in this same folder. Run 8 | 9 | `moduleit example.nix` 10 | 11 | to compile the module. It will symlink the output path to `result` in the current directory. 12 | If you want the output to be a different place, provide the path in the second argument: 13 | 14 | `moduleit example.nix /path/to/where/i/want/the/symlink` 15 | 16 | In this case, it will materialize the contents in the output path as a regular file. 17 | 18 | -------------------------------------------------------------------------------- /scripts/ci_check.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -exuo pipefail 3 | 4 | nix fmt -- --check . 5 | 6 | git grep writeShellScriptBin | grep -v "Please use writeShellApplication" && \ 7 | (echo "Please use writeShellApplication instead of writeShellScriptBin" && \ 8 | exit 1) || true 9 | 10 | NIX_FLAGS=( 11 | --extra-experimental-features nix-command 12 | --extra-experimental-features flakes 13 | ) 14 | 15 | echo "Evaluate modules derivations" 16 | nix eval "${NIX_FLAGS[@]}" .#modules --json 17 | 18 | nix develop "${NIX_FLAGS[@]}" --command echo Hello, world 19 | 20 | nix eval .#bundle 21 | -------------------------------------------------------------------------------- /pkgs/modules/run-package-json/default.nix: -------------------------------------------------------------------------------- 1 | { runPackageJsonScript, runFileScript }: 2 | 3 | { config, lib, pkgs, ... }: 4 | 5 | let 6 | script = pkgs.writeScriptBin "package-json-runner" '' 7 | #! ${pkgs.nodejs}/bin/node 8 | 9 | ${builtins.readFile ./script.js} 10 | ''; 11 | in 12 | 13 | { 14 | replit.packages = [ 15 | script 16 | ]; 17 | 18 | replit.runners."package.json" = { 19 | name = "package.json"; 20 | start = "${script}/bin/package-json-runner --run-script ${runFileScript} --run-package-json-script ${runPackageJsonScript}"; 21 | optionalFileParam = true; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Why 2 | === 3 | 4 | _Describe what prompted you to make this change, link relevant resources_ 5 | 6 | What changed 7 | ============ 8 | 9 | _Describe what changed to a level of detail that someone with no context with your PR could be able to review it_ 10 | 11 | Test plan 12 | ========= 13 | 14 | _Describe what you did to test this change to a level of detail that allows your reviewer to test it_ 15 | 16 | Rollout 17 | ======= 18 | 19 | _Describe any procedures or requirements needed to roll this out safely (or check the box below)_ 20 | 21 | - [ ] This is fully backward and forward compatible 22 | -------------------------------------------------------------------------------- /pkgs/modules/pyright/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | { 3 | id = "pyright"; 4 | name = "pyright LSP"; 5 | displayVersion = pkgs.pyright.version; 6 | description = '' 7 | Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases. 8 | ''; 9 | replit.dev.languageServers.pyright = { 10 | name = "pyright"; 11 | displayVersion = pkgs.pyright.version; 12 | language = "python3"; 13 | start = "${pkgs.pyright}/bin/pyright-langserver --stdio"; 14 | }; 15 | 16 | replit.env = { 17 | PATH = "${pkgs.pyright}/bin"; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /patches/rexml.patch: -------------------------------------------------------------------------------- 1 | diff --git a/pkgs/top-level/ruby-packages.nix b/pkgs/top-level/ruby-packages.nix 2 | index 0528d45bef84e1..18819de3029c53 100644 3 | --- a/pkgs/top-level/ruby-packages.nix 4 | +++ b/pkgs/top-level/ruby-packages.nix 5 | @@ -3127,9 +3127,9 @@ 6 | platforms = []; 7 | source = { 8 | remotes = ["https://rubygems.org"]; 9 | - sha256 = "sha256-CQioY4HZ+XOCRoDfTgp1QidmJy8DscDknbfnnCPbETU="; 10 | + sha256 = "05i8518ay14kjbma550mv0jm8a6di8yp5phzrd8rj44z9qnrlrp0"; 11 | type = "gem"; 12 | }; 13 | - version = "3.2.8"; 14 | + version = "3.2.6"; 15 | }; 16 | rmagick = { 17 | dependencies = ["observer" "pkg-config"]; -------------------------------------------------------------------------------- /pkgs/moduleit/entrypoint.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import { } 2 | , pkgs-23_05 ? import { } 3 | , pkgs-24_11 ? import { } 4 | , configPath 5 | , deployment ? false 6 | }: 7 | let 8 | module = (pkgs.lib.evalModules { 9 | modules = [ 10 | configPath 11 | (import ./module-definition.nix) 12 | ]; 13 | specialArgs = { 14 | inherit pkgs pkgs-23_05 pkgs-24_11; 15 | pkgs-unstable = pkgs; 16 | modulesPath = builtins.toString ./.; 17 | }; 18 | }); 19 | in 20 | if deployment then 21 | module.config.replit.buildDeploymentModule 22 | else 23 | module.config.replit.buildModule 24 | -------------------------------------------------------------------------------- /pkgs/replbox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@replit/replbox", 3 | "version": "3.0.0", 4 | "description": "A sandboxed browser REPL", 5 | "bin": "replbox.js", 6 | "scripts": { 7 | "prettier": "prettier --write \"src/**/*.js\"", 8 | "replbox": "node replbox.js" 9 | }, 10 | "author": "amjad@repl.it", 11 | "license": "UNLICENSED", 12 | "devDependencies": { 13 | "prettier": "^1.18.2" 14 | }, 15 | "dependencies": { 16 | "argparse": "^2.0.1", 17 | "biwascheme": "^0.7.5", 18 | "underscore": "1.2.2" 19 | }, 20 | "prettier": { 21 | "trailingComma": "all", 22 | "tabWidth": 2, 23 | "semi": true, 24 | "singleQuote": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/modules/bash/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: { 2 | id = "bash"; 3 | name = "Bash Tools"; 4 | description = '' 5 | Tools for working with the Bash shell, including Bash language server. 6 | ''; 7 | 8 | replit.runners.bash = { 9 | name = "Bash"; 10 | language = "bash"; 11 | start = "${pkgs.bashInteractive}/bin/bash $file"; 12 | optionalFileParam = true; 13 | }; 14 | 15 | replit.dev.languageServers.bash-language-server = { 16 | name = "Bash Language Server"; 17 | language = "bash"; 18 | extensions = [ ".sh" ".bash" ]; 19 | 20 | start = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server start"; 21 | }; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /pkgs/angular-language-server/default.nix: -------------------------------------------------------------------------------- 1 | # TODO: upstream this file into nixpkgs 2 | { buildNpmPackage 3 | , fetchurl 4 | }: 5 | 6 | buildNpmPackage rec { 7 | name = "@angular/language-server"; 8 | version = "17.0.3"; 9 | 10 | src = fetchurl { 11 | url = "https://registry.npmjs.org/@angular/language-server/-/language-server-${version}.tgz"; 12 | hash = "sha256-Sf5IqJR6Xwa4/LfMMwC8ArxyqcR21xT1f04lYPIpqi0="; 13 | }; 14 | 15 | postPatch = '' 16 | cp ${./package-lock.json} package-lock.json 17 | ''; 18 | 19 | npmDepsHash = "sha256-C+3Q48lvJs/YwZSnlKsIREKVTaam9F47t2Kq+JcZJ0w="; 20 | dontNpmBuild = true; 21 | 22 | meta = { 23 | mainProgram = "ngserver"; 24 | }; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /pkgs/bundle-image/default.nix: -------------------------------------------------------------------------------- 1 | { system 2 | , bash 3 | , lib 4 | , bundle 5 | , revstring 6 | , coreutils 7 | , findutils 8 | , closureInfo 9 | , squashfsTools 10 | , fetchFromGitHub 11 | , pkgs 12 | , diskName 13 | }: 14 | 15 | let 16 | label = "nixmodules-${revstring}"; 17 | in 18 | 19 | derivation { 20 | name = label; 21 | builder = "${bash}/bin/bash"; 22 | args = [ ./builder.sh ]; 23 | inherit system; 24 | __structuredAttrs = true; 25 | unsafeDiscardReferences.out = true; 26 | env = { 27 | inherit label bundle diskName; 28 | PATH = lib.makeBinPath [ 29 | coreutils 30 | findutils 31 | squashfsTools 32 | ]; 33 | diskClosureInfo = closureInfo { rootPaths = [ bundle ]; }; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /pkgs/modules/python/sitecustomize.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | # Use this sitecustomize.py (a directory containing it in PYTHONPATH) to 3 | # overwrite pip's shebang line treatment so it doesn't use hard-coded paths 4 | # to the python executable, so we could update Python without editing Repls 5 | # Using this approach also allows this scheme to work with a version of pip 6 | # which the user has installed into their .pythonlibs, which can happen if they 7 | # upgrade pip. 8 | let 9 | dirpath = "lib/python/site-packages"; 10 | textFile = pkgs.writeTextFile { 11 | name = "sitecustomize"; 12 | text = builtins.readFile ./sitecustomize.py; 13 | destination = "/${dirpath}/sitecustomize.py"; 14 | }; 15 | in 16 | "${textFile}/${dirpath}" 17 | -------------------------------------------------------------------------------- /pkgs/vue-language-server/default.nix: -------------------------------------------------------------------------------- 1 | # TODO: upstream this file into nixpkgs 2 | { buildNpmPackage 3 | , fetchurl 4 | , nodejs 5 | }: 6 | 7 | buildNpmPackage rec { 8 | name = "@vue/language-server"; 9 | version = "1.8.25"; 10 | 11 | src = fetchurl { 12 | url = "https://registry.npmjs.org/@vue/language-server/-/language-server-${version}.tgz"; 13 | hash = "sha256-dwciS5zJ1S8q3jqoJ6gzLn5UHpQuTqVNX3BFS5L2B5g="; 14 | }; 15 | 16 | postPatch = '' 17 | cp ${./package-lock.json} package-lock.json 18 | ''; 19 | 20 | npmDepsHash = "sha256-vsZqtue2FjMrcKNznD/jhoMXoP96bFzj9E+rTg2SJe8="; 21 | dontNpmBuild = true; 22 | 23 | meta = { 24 | mainProgram = "vue-language-server"; 25 | }; 26 | 27 | inherit nodejs; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /pkgs/modules/clojure/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let clojure-version = lib.versions.majorMinor pkgs.clojure.version; 3 | in 4 | { 5 | id = "clojure-${clojure-version}"; 6 | name = "Clojure Tools"; 7 | displayVersion = clojure-version; 8 | description = '' 9 | Tools for working with Clojure. Includes Clojure and Clojure language server. 10 | ''; 11 | 12 | replit.runners.clojure = { 13 | name = "Clojure"; 14 | language = "clojure"; 15 | 16 | start = "${pkgs.clojure}/bin/clojure -M $file"; 17 | fileParam = true; 18 | }; 19 | 20 | replit.dev.languageServers.clojure-lsp = { 21 | name = "Clojure LSP"; 22 | language = "clojure"; 23 | 24 | start = "${pkgs.clojure-lsp}/bin/clojure-lsp"; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/dapPython/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, python, pypkgs, debugpy ? pypkgs.debugpy }: 2 | 3 | let 4 | pythonVersion = pkgs.lib.versions.majorMinor python.version; 5 | in 6 | pkgs.stdenv.mkDerivation { 7 | name = "dap-python"; 8 | version = debugpy.version; 9 | propagatedBuildInputs = [ 10 | (python.withPackages (_: [ 11 | debugpy 12 | ])) 13 | ]; 14 | dontUnpack = true; 15 | installPhase = '' 16 | mkdir -p $out/bin 17 | cp ${./wrapper.py} $out/bin/dap-python 18 | chmod +x $out/bin/dap-python 19 | 20 | substituteInPlace $out/bin/dap-python \ 21 | --replace "@python-bin@" "${python}/bin/python3" \ 22 | --replace "@debugpy-path@" "${debugpy.out}/lib/python${pythonVersion}/site-packages" 23 | ''; 24 | } 25 | -------------------------------------------------------------------------------- /pkgs/modules/lua/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let lua-version = lib.versions.majorMinor pkgs.lua.version; 3 | in 4 | { 5 | id = "lua-${lua-version}"; 6 | name = "Lua Tools"; 7 | displayVersion = lua-version; 8 | description = '' 9 | Lua development tools. Includes Lua and Lua language server. 10 | ''; 11 | 12 | replit.packages = with pkgs; [ 13 | lua 14 | ]; 15 | 16 | replit.runners.run = { 17 | name = "Lua script"; 18 | language = "lua"; 19 | 20 | start = "lua $file"; 21 | fileParam = true; 22 | }; 23 | 24 | replit.dev.languageServers.sumneko = { 25 | name = "lua-language-server"; 26 | language = "lua"; 27 | 28 | start = "${pkgs.sumneko-lua-language-server}/bin/lua-language-server"; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /pkgs/modules/ruff/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | { 3 | id = "ruff"; 4 | name = "ruff LSP"; 5 | displayVersion = pkgs.ruff.version; 6 | description = '' 7 | A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. 8 | 9 | Ruff can be used to replace Flake8 (plus dozens of plugins), Black, isort, pyupgrade, and more, all while executing tens or hundreds of times faster than any individual tool. 10 | ''; 11 | replit.dev.languageServers.ruff = { 12 | name = "ruff"; 13 | displayVersion = pkgs.ruff.version; 14 | language = "python3"; 15 | start = "${pkgs.ruff}/bin/ruff server"; 16 | }; 17 | 18 | replit.env = { 19 | PATH = "${pkgs.ruff}/bin"; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/modules/qbasic/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | replbox = pkgs.callPackage ../../replbox { }; 5 | run-replbox = pkgs.writeShellApplication { 6 | name = "run-replbox"; 7 | text = '' 8 | ${replbox}/bin/replit-replbox \ 9 | --ps1 "''$(printf '\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ')" \ 10 | -i qbasic "''$1" 11 | ''; 12 | }; 13 | in 14 | 15 | { 16 | id = "qbasic"; 17 | name = "QBASIC Tools (with Replbox)"; 18 | description = '' 19 | QBasic with Replbox. 20 | ''; 21 | 22 | replit.runners.replbox-qbasic = { 23 | name = "ReplBox QBASIC"; 24 | language = "basic"; 25 | 26 | start = "${run-replbox}/bin/run-replbox $file"; 27 | interpreter = true; 28 | fileParam = true; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /pkgs/mk-phony-oci/default.nix: -------------------------------------------------------------------------------- 1 | { system 2 | , bash 3 | , lib 4 | , coreutils 5 | , closureInfo 6 | , gnutar 7 | , pigz 8 | , ztoc-rs 9 | }: 10 | 11 | { module, moduleId }: 12 | let 13 | sanitizedModuleId = builtins.replaceStrings [ ":" ] [ "_" ] moduleId; 14 | in 15 | derivation { 16 | name = "oci-image-${sanitizedModuleId}"; 17 | builder = "${bash}/bin/bash"; 18 | args = [ ./builder.sh ]; 19 | inherit system; 20 | __structuredAttrs = true; 21 | unsafeDiscardReferences.out = true; 22 | outputs = [ "out" ]; 23 | env = { 24 | MODULE_ID = moduleId; 25 | PATH = lib.makeBinPath [ 26 | coreutils 27 | coreutils 28 | gnutar 29 | pigz 30 | ztoc-rs 31 | ]; 32 | diskClosureInfo = closureInfo { rootPaths = [ module ]; }; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /pkgs/modules/R/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let r-version = lib.versions.majorMinor pkgs.R.version; 3 | in 4 | { 5 | id = "r-${r-version}"; 6 | name = "R Tools"; 7 | displayVersion = r-version; 8 | description = '' 9 | R project for statistical computing. 10 | ''; 11 | 12 | replit.packages = [ 13 | pkgs.R 14 | ]; 15 | 16 | replit.runners.r = { 17 | name = "R"; 18 | language = "r"; 19 | 20 | start = "${pkgs.R}/bin/R -s -f $file"; 21 | fileParam = true; 22 | }; 23 | 24 | replit.dev.packagers.r = { 25 | name = "R packager"; 26 | language = "r"; 27 | features = { 28 | packageSearch = true; 29 | guessImports = false; 30 | enabledForHosting = false; 31 | }; 32 | }; 33 | 34 | replit.env = { 35 | R_LIBS_USER = "$REPL_HOME/.config/R"; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /pkgs/modules/python/pip.nix: -------------------------------------------------------------------------------- 1 | pkgs @ { pypkgs, ... }: 2 | 3 | let 4 | pip = pypkgs.pip.overridePythonAttrs (old: rec { 5 | outputs = [ 6 | "out" 7 | ]; 8 | # Skip building the docs for pip because that was failing 9 | # with a sphinx-build error with a version of nixpkgs-unstable for 3.10 (worked for >3.11) 10 | # and we don't need the docs 11 | postBuild = ""; 12 | postInstall = ""; 13 | 14 | nativeBuildInputs = [ 15 | pkgs.installShellFiles 16 | pypkgs.setuptools 17 | pypkgs.wheel 18 | ]; 19 | }); 20 | 21 | config = pkgs.writeTextFile { 22 | name = "pip.conf"; 23 | text = '' 24 | [global] 25 | user = yes 26 | disable-pip-version-check = yes 27 | break-system-packages = yes 28 | ''; 29 | }; 30 | in 31 | { 32 | inherit pip config; 33 | } 34 | -------------------------------------------------------------------------------- /pkgs/java-debug/repo.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , maven 3 | , jdk 4 | , src 5 | , patches 6 | }: 7 | stdenv.mkDerivation { 8 | inherit src patches; 9 | name = "java-debug-repo"; 10 | 11 | dontConfigure = true; 12 | buildInputs = [ maven jdk ]; 13 | buildPhase = "${maven}/bin/mvn -Dmaven.repo.local=$out package"; 14 | 15 | # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside 16 | installPhase = '' 17 | echo $out 18 | 19 | find $out -type f -name \*.lastUpdated -delete 20 | find $out -type f -name resolver-status.properties -delete 21 | find $out -type f -name _remote.repositories -delete 22 | ''; 23 | 24 | # don't do any fixup 25 | dontFixup = true; 26 | outputHashAlgo = "sha256"; 27 | outputHashMode = "recursive"; 28 | outputHash = "eqUv4tMhdBkRWOGmIMbSFpDZl9B1Aq+P3cKAF3m9sZY="; 29 | } 30 | -------------------------------------------------------------------------------- /pkgs/modules/deno/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | inherit (pkgs) deno; 5 | version = lib.versions.major deno.version; 6 | 7 | extensions = [ ".json" ".jsonc" ".js" ".jsx" ".ts" ".tsx" ]; 8 | in 9 | 10 | { 11 | id = "deno-${version}"; 12 | name = "Deno Tools"; 13 | displayVersion = version; 14 | description = '' 15 | Tools for working with Deno. Includes Deno and Deno language server. 16 | ''; 17 | 18 | replit.packages = [ 19 | deno 20 | ]; 21 | 22 | replit.runners.deno-script-runner = { 23 | name = "deno"; 24 | language = "javascript"; 25 | inherit extensions; 26 | fileParam = true; 27 | start = "${deno}/bin/deno run --allow-all $file"; 28 | }; 29 | 30 | replit.dev.languageServers.deno = { 31 | name = "deno"; 32 | language = "javascript"; 33 | inherit extensions; 34 | start = "${deno}/bin/deno lsp --quiet"; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /pkgs/java-debug/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , callPackage 3 | , makeWrapper 4 | , jdt-language-server 5 | , python3 6 | , jdk 7 | }: 8 | let 9 | debug-plugin = callPackage ./debug-plugin.nix { 10 | inherit jdk; 11 | }; 12 | 13 | in 14 | stdenv.mkDerivation { 15 | name = "java-debug"; 16 | version = debug-plugin.version; 17 | 18 | unpackPhase = "true"; 19 | dontBuild = true; 20 | 21 | nativeBuildInputs = [ python3 ]; 22 | buildInputs = [ makeWrapper ]; 23 | installPhase = '' 24 | mkdir -p $out/bin 25 | cp ${./java-dap} $out/bin/java-dap 26 | patchShebangs $out/bin/java-dap 27 | 28 | makeWrapper $out/bin/java-dap $out/bin/java-debug \ 29 | --add-flags --use-ephemeral-port \ 30 | --add-flags --debug-plugin \ 31 | --add-flags ${debug-plugin}/lib/java-debug.jar \ 32 | --add-flags --language-server \ 33 | --add-flags ${jdt-language-server}/bin/jdt-language-server 34 | ''; 35 | } 36 | -------------------------------------------------------------------------------- /pkgs/python-wrapped/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, python, python-ld-library-path }: 2 | pkgs.buildGoModule rec { 3 | pname = "python-wrapped"; 4 | version = "0.1.0"; 5 | 6 | src = ./.; 7 | 8 | ldflags = [ 9 | "-X main.ReplitPythonLdLibraryPath=${python-ld-library-path}" 10 | "-X main.PythonExePath=${python}/bin/python" 11 | ]; 12 | 13 | vendorHash = null; 14 | 15 | meta = with pkgs.lib; { 16 | description = '' 17 | A replit proxy to Python which interpolates some critical bits 18 | of the environment at runtime 19 | ''; 20 | homepage = "https://replit.com"; 21 | license = licenses.mit; 22 | mainProgram = "python"; 23 | }; 24 | 25 | postInstall = '' 26 | cd $out/bin 27 | mv python-wrapper .python-wrapped 28 | ln -s .python-wrapped python 29 | ln -s .python-wrapped python${pkgs.lib.versions.major python.version} 30 | ln -s .python-wrapped python${pkgs.lib.versions.majorMinor python.version} 31 | ''; 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/moduleit/moduleit.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | if [ $# -eq 0 ]; then 4 | echo "Please provide a module file argument" 5 | exit 1 6 | fi 7 | 8 | MODULE_FILE="$1" 9 | OUTPUT_FILE="$2" 10 | 11 | MODULE_FILE_ABSOLUTE_PATH="$(realpath $MODULE_FILE)" 12 | SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" 13 | ENTRYPOINT_PATH="$SCRIPT_DIR/entrypoint.nix" 14 | 15 | args=("$ENTRYPOINT_PATH" --argstr configPath "$MODULE_FILE_ABSOLUTE_PATH") 16 | 17 | if [ ! -z "${OUTPUT_FILE}" ]; then 18 | args+=(--out-link "${OUTPUT_FILE}") 19 | 20 | if [[ -f "${OUTPUT_FILE}" ]]; then 21 | rm -f "${OUTPUT_FILE}" 22 | fi 23 | fi 24 | 25 | echo "nix-build ${args[@]}" 26 | nix-build "${args[@]}" 27 | 28 | if [ -L "${OUTPUT_FILE}" ]; then 29 | # If output link was provided, 30 | # materialize the output as an actual file containing the JSON config 31 | # instead of a symlink 32 | cp --remove-destination "$(realpath "${OUTPUT_FILE}")" "${OUTPUT_FILE}" 33 | fi 34 | -------------------------------------------------------------------------------- /pkgs/modules/elixir/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | elixir-version = builtins.replaceStrings [ "." ] [ "_" ] (lib.versions.majorMinor "${pkgs.elixir.version}"); 5 | in 6 | 7 | { 8 | id = "elixir-${elixir-version}"; 9 | name = "Elixir ${elixir-version} Tools"; 10 | displayVersion = elixir-version; 11 | description = '' 12 | Development tools for Elixir. Includes Elixir and Elixir language server. 13 | ''; 14 | 15 | replit.packages = [ 16 | pkgs.elixir 17 | pkgs.elixir-ls 18 | ]; 19 | 20 | replit.runners.elixir = { 21 | name = "mix run"; 22 | language = "elixir"; 23 | start = "${pkgs.elixir}/bin/mix run"; 24 | }; 25 | 26 | replit.dev.languageServers.elixir = { 27 | name = "Elixir Language Server (ElixirLS)"; 28 | language = "elixir"; 29 | start = "${pkgs.elixir-ls}/bin/elixir-ls"; 30 | }; 31 | 32 | replit.env = { 33 | HEX_HOME = "$REPL_HOME/.hex"; 34 | MIX_HOME = "$REPL_HOME/.mix"; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /pkgs/modules/dart/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let dart-version = lib.versions.majorMinor pkgs.dart.version; 3 | in { 4 | id = "dart-${dart-version}"; 5 | name = "Dart Tools"; 6 | displayVersion = dart-version; 7 | description = '' 8 | Tools for working with Dart. Includes Dart, Dart language server, Dart pub package manager. 9 | ''; 10 | 11 | replit.packages = [ 12 | pkgs.dart 13 | ]; 14 | 15 | replit.runners.dart = { 16 | name = "dart"; 17 | language = "dart"; 18 | 19 | start = "${pkgs.dart}/bin/dart main.dart"; 20 | }; 21 | 22 | replit.dev.languageServers.dart-pub = { 23 | name = "dart"; 24 | language = "dart"; 25 | 26 | start = "${pkgs.dart}/bin/dart language-server"; 27 | }; 28 | 29 | replit.dev.packagers.dart-pub = { 30 | name = "Dart pub"; 31 | language = "dart-pub"; 32 | features = { 33 | packageSearch = true; 34 | guessImports = false; 35 | enabledForHosting = false; 36 | }; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /pkgs/mk-phony-ocis/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs 2 | , revstring 3 | , modulesLocks 4 | , mkPhonyOCI 5 | }: 6 | 7 | with pkgs.lib; 8 | 9 | let 10 | commits = unique (catAttrs "commit" (builtins.attrValues modulesLocks)); 11 | 12 | flakes = builtins.listToAttrs ( 13 | map 14 | (commit: { 15 | name = commit; 16 | value = builtins.getFlake "github:replit/nixmodules/${commit}"; 17 | }) 18 | commits); 19 | 20 | phonyOCIs = builtins.mapAttrs 21 | (name: module: 22 | let 23 | module-id = elemAt (strings.splitString ":" name) 0; 24 | m = (flakes.${module.commit}).deploymentModules.${module-id}; 25 | in 26 | # verify the outpath matches what the lockfile expects 27 | assert m.outPath == module.path; 28 | mkPhonyOCI { module = m; moduleId = name; }) 29 | modulesLocks; 30 | 31 | in 32 | 33 | pkgs.linkFarm "nixmodules-phonyOCI-${revstring}" ( 34 | mapAttrsToList (name: value: { inherit name; path = value; }) phonyOCIs 35 | ) 36 | -------------------------------------------------------------------------------- /pkgs/modules/typescript-language-server/default.nix: -------------------------------------------------------------------------------- 1 | { nodepkgs }: 2 | { pkgs, lib, ... }: 3 | let 4 | inherit (nodepkgs) typescript-language-server; 5 | in 6 | { 7 | id = lib.mkDefault "typescript-language-server"; 8 | name = lib.mkDefault "TypeScript Language Server"; 9 | displayVersion = lib.mkDefault (lib.versions.majorMinor typescript-language-server.version); 10 | description = lib.mkDefault '' 11 | TypeScript (& JavaScript) language server. 12 | ''; 13 | replit.dev.languageServers.typescript-language-server = { 14 | name = "TypeScript Language Server"; 15 | displayVersion = typescript-language-server.version; 16 | language = "javascript"; 17 | start = "${typescript-language-server}/bin/typescript-language-server --stdio"; 18 | 19 | initializationOptions = { 20 | tsserver.fallbackPath = "${nodepkgs.typescript}/lib/node_modules/typescript/lib"; 21 | }; 22 | 23 | extensions = [ ".js" ".jsx" ".ts" ".tsx" ".mjs" ".mts" ".cjs" ".cts" ".es6" ".json" ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/modules/svelte-kit/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | id = "svelte-kit-node-20"; 5 | name = "SvelteKit Tools with Node.js"; 6 | displayVersion = "20"; 7 | description = '' 8 | Svelte Kit development tools. Includes Node.js, Svelte language server. 9 | ''; 10 | 11 | replit = { 12 | packages = with pkgs; [ 13 | nodejs 14 | ]; 15 | 16 | # Nothing required for deployment because app compiles to a static site 17 | dev.runners.dev-server = { 18 | name = "package.json dev script"; 19 | language = "svelte"; 20 | extensions = [ 21 | ".svelte" 22 | ".js" 23 | ".ts" 24 | ]; 25 | 26 | start = "${pkgs.nodejs}/bin/npm run dev"; 27 | }; 28 | 29 | dev.languageServers.svelte-language-server = { 30 | name = "Svelte Language Server"; 31 | language = "svelte"; 32 | extensions = [ ".svelte" ".js" ".ts" ]; 33 | start = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver --stdio"; 34 | }; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /pkgs/pyright-extended/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, yapf, nodejs, ... }: 2 | let 3 | version = "2.0.13"; 4 | in 5 | pkgs.stdenvNoCC.mkDerivation rec { 6 | pname = "pyright-extended"; 7 | inherit version; 8 | 9 | src = pkgs.fetchurl { 10 | url = "https://registry.npmjs.org/@replit/pyright-extended/-/pyright-extended-${version}.tgz"; 11 | hash = "sha256-i4AOpkXF7YOLvcO4n5wDUjBSefFHnjFkSydJfRkMOX4="; 12 | }; 13 | 14 | binPath = lib.makeBinPath [ 15 | pkgs.ruff 16 | yapf 17 | nodejs 18 | ]; 19 | 20 | nativeBuildInputs = [ 21 | pkgs.makeWrapper 22 | ]; 23 | 24 | dontConfigure = true; 25 | dontBuild = true; 26 | 27 | installPhase = '' 28 | runHook preInstall 29 | mkdir -p $out/lib 30 | cp -r . $out/lib 31 | mkdir -p $out/bin 32 | makeWrapper "$out/lib/index.js" "$out/bin/index.js" \ 33 | --prefix PATH : "${binPath}" 34 | makeWrapper "$out/lib/langserver.index.js" "$out/bin/langserver.index.js" \ 35 | --prefix PATH : "${binPath}" 36 | runHook postInstall 37 | ''; 38 | } 39 | -------------------------------------------------------------------------------- /pkgs/bundle/default.nix: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Returns a function taking: 4 | * a list of module IDs to filter by 5 | Returns a derivation that builds a directory containing: 6 | * /etc/nixmodules/modules.json 7 | * a symlink per module ID passed in, resolving to a JSON file containing 8 | the toolchain supplied by that module 9 | 10 | */ 11 | { pkgs, lib, self, ... }: 12 | with builtins; 13 | with pkgs.lib; 14 | { moduleIds ? null }: 15 | let 16 | modules = self.modules; 17 | filteredModules = 18 | if moduleIds == null 19 | then modules else 20 | filterAttrs (moduleId: _: elem moduleId moduleIds) modules; 21 | modulesMap = mapAttrs 22 | (name: drv: { 23 | path = drv.outPath; 24 | }) 25 | filteredModules; 26 | in 27 | pkgs.linkFarm "nixmodules-bundle" ([ 28 | { 29 | name = "etc/nixmodules/modules.json"; 30 | path = pkgs.writeTextFile { 31 | name = "modules.json"; 32 | text = builtins.toJSON modulesMap; 33 | }; 34 | } 35 | ] ++ (mapAttrsToList (name: value: { inherit name; path = value; }) filteredModules)) 36 | -------------------------------------------------------------------------------- /pkgs/modules/php/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | php-version = lib.versions.majorMinor pkgs.php.version; 4 | in 5 | { 6 | id = "php-${php-version}"; 7 | name = "PHP Tools"; 8 | displayVersion = php-version; 9 | description = '' 10 | PHP development tools. Includes PHP: Hypertext Preprocessor, Phpactor language server, Composer package manager. 11 | ''; 12 | 13 | replit.packages = with pkgs; [ 14 | php 15 | pkgs.phpPackages.composer 16 | ]; 17 | 18 | replit.runners.php = { 19 | name = "php run"; 20 | language = "php"; 21 | start = "${pkgs.php}/bin/php $file"; 22 | fileParam = true; 23 | }; 24 | 25 | replit.dev.languageServers.phpactor = { 26 | name = "phpactor"; 27 | language = "php"; 28 | 29 | start = "${pkgs.phpactor}/bin/phpactor language-server"; 30 | }; 31 | 32 | replit.dev.packagers.php = { 33 | name = "PHP Composer"; 34 | language = "php"; 35 | features = { 36 | packageSearch = true; 37 | guessImports = false; 38 | enabledForHosting = false; 39 | }; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /pkgs/java-debug/debug-plugin.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , maven 3 | , fetchFromGitHub 4 | , jdk 5 | , callPackage 6 | }: 7 | let 8 | version = "0.37.0"; 9 | 10 | src = fetchFromGitHub { 11 | owner = "replit"; 12 | repo = "java-debug"; 13 | rev = "main"; 14 | sha256 = "RR3Atw2B5ttT+K10wGD+OsDOeMlcNVEqA/7ZTixCXCQ="; 15 | }; 16 | repository = callPackage ./repo.nix { 17 | inherit src jdk patches; 18 | }; 19 | 20 | patches = [ 21 | ./patches/repo.diff 22 | ]; 23 | 24 | in 25 | stdenv.mkDerivation { 26 | inherit version src patches; 27 | name = "java-debug-plugin"; 28 | 29 | buildInputs = [ maven jdk ]; 30 | buildPhase = '' 31 | # Maven tries to grab lockfiles in the repository, so it has to be writeable 32 | cp -a ${repository} ./repository 33 | chmod u+w -R ./repository 34 | ${maven}/bin/mvn --offline -Dmaven.repo.local=./repository package 35 | ''; 36 | 37 | installPhase = '' 38 | mkdir -p $out/lib 39 | cp com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-${version}.jar $out/lib/java-debug.jar 40 | ''; 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Replit 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pkgs/modules/haskell/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | ghc-version = lib.versions.majorMinor pkgs.ghc.version; 4 | in 5 | { 6 | id = "haskell-ghc${ghc-version}"; 7 | name = "Haskell Tools"; 8 | displayVersion = ghc-version; 9 | description = '' 10 | Haskell development tools. Includes GHCi - Glasgow Haskell Compiler, and Haskell language server. 11 | ''; 12 | 13 | replit.packages = with pkgs; [ 14 | ghc 15 | ]; 16 | 17 | replit.runners.runghc = { 18 | name = "GHC app"; 19 | language = "haskell"; 20 | 21 | start = "${pkgs.ghc}/bin/runghc $file"; 22 | fileParam = true; 23 | }; 24 | 25 | # TODO: allow users to select runners 26 | # replit.runners.ghci = { 27 | # name = "ghci"; 28 | # language = "haskell"; 29 | 30 | # start = "${pkgs.ghc}/bin/ghci $file"; 31 | # fileParam = true; 32 | # interpreter = true; 33 | # }; 34 | 35 | replit.dev.languageServers.haskell-language-server = { 36 | name = "Haskell Language Server"; 37 | language = "haskell"; 38 | 39 | start = "${pkgs.haskellPackages.haskell-language-server}/bin/haskell-language-server --lsp"; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /pkgs/modules/hermit/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | version = "0.38.2"; 4 | 5 | hermit = pkgs.buildGoModule rec { 6 | pname = "hermit"; 7 | version = "0.38.2"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | rev = "v${version}"; 11 | owner = "cashapp"; 12 | repo = "hermit"; 13 | hash = "sha256-cBVTIpY85lrKJ1bX1mIlUW1oWEHgg8wjdUh+0FHUp80="; 14 | }; 15 | 16 | vendorHash = "sha256-W8n7WA1gHx73jHF69apoKnDCIKlbWkj5f1wVITt7F+M="; 17 | 18 | subPackages = [ "cmd/hermit" ]; 19 | 20 | ldflags = [ 21 | "-X main.version=${version}" 22 | "-X main.channel=stable" 23 | ]; 24 | 25 | meta = with lib; { 26 | homepage = "https://cashapp.github.io/hermit"; 27 | description = "Hermit manages isolated, self-bootstrapping sets of tools in software projects."; 28 | license = licenses.asl20; 29 | mainProgram = "hermit"; 30 | }; 31 | }; 32 | in 33 | { 34 | id = "hermit-${version}"; 35 | name = "Hermit Environment Manager"; 36 | displayVersion = version; 37 | description = "Hermit manages isolated, self-bootstrapping sets of tools in software projects."; 38 | 39 | replit.dev.packages = [ 40 | hermit 41 | ]; 42 | } 43 | -------------------------------------------------------------------------------- /pkgs/modules/swift/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs-23_05, lib, ... }: 2 | let 3 | pkgs = pkgs-23_05; 4 | swift-version = lib.versions.majorMinor pkgs.swift.version; 5 | 6 | swiftc-wrapper = pkgs.stdenv.mkDerivation { 7 | name = "swiftc-wrapper"; 8 | buildInputs = [ pkgs.makeWrapper ]; 9 | src = ./.; 10 | 11 | 12 | installPhase = '' 13 | mkdir -p $out/bin 14 | makeWrapper ${pkgs.swift}/bin/swiftc $out/bin/swiftc \ 15 | --set PATH "" 16 | ''; 17 | }; 18 | in 19 | { 20 | id = "swift-${swift-version}"; 21 | name = "Swift Tools"; 22 | displayVersion = swift-version; 23 | description = '' 24 | Swift development tools. Includes Swift compiler, Sourcekit language server. 25 | ''; 26 | 27 | replit.packages = with pkgs; [ 28 | swiftc-wrapper 29 | swift 30 | ]; 31 | 32 | # TODO: should compile a binary to be used in deployment 33 | replit.runners.swift = { 34 | name = "Swift"; 35 | language = "swift"; 36 | start = "${pkgs.swift}/bin/swift $file"; 37 | fileParam = true; 38 | }; 39 | 40 | replit.dev.languageServers.sourcekit = { 41 | name = "SourceKit"; 42 | language = "swift"; 43 | 44 | start = "${pkgs.swift}/bin/sourcekit-lsp"; 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /pkgs/modules/dotnet/default.nix: -------------------------------------------------------------------------------- 1 | { dotnet }: 2 | { pkgs, lib, ... }: 3 | 4 | let 5 | dotnetVersion = lib.versions.major dotnet.version; 6 | 7 | extensions = [ ".cs" ".csproj" ".fs" ".fsproj" ]; 8 | 9 | dotnet-version = lib.versions.majorMinor dotnet.version; 10 | in 11 | 12 | { 13 | id = "dotnet-${dotnet-version}"; 14 | name = ".NET ${dotnet-version} Tools"; 15 | displayVersion = dotnet-version; 16 | description = '' 17 | .NET ${dotnetVersion} development tools. Includes .NET and OmniSharp. 18 | ''; 19 | 20 | replit.packages = [ 21 | dotnet 22 | ]; 23 | 24 | replit.runners.dotnet = { 25 | inherit extensions; 26 | name = ".NET"; 27 | language = "dotnet"; 28 | 29 | start = "${dotnet}/bin/dotnet run"; 30 | }; 31 | 32 | replit.dev.languageServers.omni-sharp = { 33 | inherit extensions; 34 | name = "OmniSharp"; 35 | language = "dotnet"; 36 | 37 | start = "${pkgs.omnisharp-roslyn}/bin/OmniSharp --languageserver"; 38 | }; 39 | 40 | replit.dev.packagers.dotnet = { 41 | name = ".NET packager"; 42 | language = "dotnet"; 43 | features = { 44 | packageSearch = true; 45 | guessImports = false; 46 | enabledForHosting = false; 47 | }; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /.github/workflows/update-weekly.yml: -------------------------------------------------------------------------------- 1 | name: weekly updates 2 | 3 | on: 4 | schedule: 5 | - cron: "0 18 * * 1" # NOTE: Mondays at 6 pm GMT 6 | 7 | jobs: 8 | fenix: 9 | runs-on: "ubuntu-latest" 10 | steps: 11 | - name: checkout 12 | uses: actions/checkout@v4 13 | 14 | - name: install Nix 15 | uses: DeterminateSystems/nix-installer-action@main 16 | 17 | - name: update Fenix 18 | run: nix flake lock --update-input fenix 19 | 20 | - name: open PR 21 | uses: peter-evans/create-pull-request@v5 22 | with: 23 | commit-message: update Fenix 24 | branch: actions/update-weekly 25 | title: Fenix update 26 | body: >- 27 | # Why 28 | 29 | Rustaceans like having the latest nightly. Let's give it to them. 30 | 31 | # What Changed 32 | 33 | Updated fenix input. 34 | 35 | # Notes 36 | 37 | ***Please*** test before merging! 38 | 39 | This PR is created via a GitHub Actions Workflow. Please 40 | take care to ensure its contents are correct. This Workflow 41 | runs every week to ensure the rust-nightly module is regularly 42 | updated. 43 | -------------------------------------------------------------------------------- /pkgs/modules/nodejs-with-prybar/default.nix: -------------------------------------------------------------------------------- 1 | { nodejs }: 2 | { pkgs, lib, ... }: 3 | let 4 | nodeVersion = lib.versions.major nodejs.version; 5 | 6 | prybar = pkgs.prybar.prybar-nodejs; 7 | 8 | run-prybar = pkgs.writeShellApplication { 9 | name = "run-prybar"; 10 | text = '' 11 | ${prybar}/bin/prybar-nodejs -q --ps1 "''$(printf '\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ')" -i "''$1" 12 | ''; 13 | }; 14 | in 15 | { 16 | 17 | id = lib.mkForce "nodejs-with-prybar-${nodeVersion}"; 18 | 19 | name = lib.mkForce "Node.js Tools (with Prybar)"; 20 | displayVersion = nodeVersion; 21 | demoted = true; 22 | description = lib.mkForce '' 23 | Node.js tools with the Prybar interpreter. Prybar is an interactive console that allows you to type and evaluate JavaScript code in a prompt after hitting "Run". 24 | ''; 25 | 26 | imports = [ 27 | (import ../nodejs { 28 | inherit nodejs; 29 | }) 30 | ]; 31 | 32 | replit.packages = [ 33 | run-prybar 34 | ]; 35 | 36 | replit.runners = lib.mkForce { 37 | nodeJS-prybar = { 38 | name = "Prybar for Node.js"; 39 | language = "javascript"; 40 | start = "${run-prybar}/bin/run-prybar $file"; 41 | optionalFileParam = true; 42 | }; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /pkgs/dap-cpp/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, stdenv, fetchurl, bash, coreutils, unzip }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "vscode-cpptools-dap"; 5 | version = "1.3.1"; 6 | 7 | phases = "installPhase fixupPhase"; 8 | 9 | src = fetchurl { 10 | url = "https://github.com/microsoft/vscode-cpptools/releases/download/${version}/cpptools-linux.vsix"; 11 | sha256 = "e88008c3d1a19e2b65152b39b94a792b451fad99e51da59f0500e6efd2ccc168"; 12 | }; 13 | 14 | # TODO: this has an implicit dependency on gdb. 15 | 16 | buildInputs = [ bash coreutils unzip ]; 17 | 18 | installPhase = '' 19 | mkdir -p $out/share/dap/cpp $out/bin 20 | ${unzip}/bin/unzip -q ${src} -d $out/share/dap/cpp 21 | chmod +x $out/share/dap/cpp/extension/debugAdapters/OpenDebugAD7 $out/share/dap/cpp/extension/debugAdapters/mono.linux-x86_64 22 | 23 | # OpenDebugAD7 doesn't quite like being called through a symlink, since it 24 | # does some path manipulation based on $0. Create a tiny wrapper shell script 25 | # for it. 26 | cat< $out/bin/dap-cpp 27 | #!${stdenv.shell} 28 | export PATH="${pkgs.lib.makeBinPath [pkgs.gdb pkgs.coreutils]}" 29 | exec $out/share/dap/cpp/extension/debugAdapters/OpenDebugAD7 "\$@" 30 | EOF 31 | chmod +x $out/bin/dap-cpp 32 | ''; 33 | } 34 | -------------------------------------------------------------------------------- /pkgs/modules/bun/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | bun = pkgs.callPackage ../../bun { }; 5 | bun-wrapped = pkgs.lib.mkWrapper-replit_ld_library_path bun; 6 | 7 | extensions = [ ".js" ".jsx" ".cjs" ".mjs" ".ts" ".tsx" ".mts" ]; 8 | 9 | community-version = lib.versions.majorMinor bun.version; 10 | in 11 | 12 | { 13 | id = "bun-${community-version}"; 14 | name = "Bun Tools"; 15 | description = '' 16 | Development tools for the Bun JavaScript runtime. Includes Bun runtime, Bun packager and TypeScript language server. 17 | ''; 18 | displayVersion = bun.version; 19 | 20 | imports = [ 21 | (import ../run-package-json { 22 | runPackageJsonScript = "${bun-wrapped}/bin/bun run"; 23 | runFileScript = "${bun-wrapped}/bin/bun"; 24 | }) 25 | (import ../typescript-language-server { 26 | nodepkgs = pkgs.nodePackages; 27 | }) 28 | ]; 29 | 30 | replit.packages = [ 31 | bun-wrapped 32 | ]; 33 | 34 | replit.runners."package.json" = { 35 | language = "javascript"; 36 | inherit extensions; 37 | }; 38 | 39 | replit.dev.packagers.bun = { 40 | name = "Bun packager"; 41 | language = "bun"; 42 | features = { 43 | packageSearch = true; 44 | guessImports = true; 45 | enabledForHosting = false; 46 | }; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /pkgs/dap-cpp/messages.nix: -------------------------------------------------------------------------------- 1 | { 2 | dapInitializeMessage = { 3 | command = "initialize"; 4 | type = "request"; 5 | arguments = { 6 | adapterID = "cppdbg"; 7 | clientID = "replit"; 8 | clientName = "replit.com"; 9 | columnsStartAt1 = true; 10 | linesStartAt1 = true; 11 | locale = "en-us"; 12 | pathFormat = "path"; 13 | supportsInvalidatedEvent = true; 14 | supportsProgressReporting = true; 15 | supportsRunInTerminalRequest = true; 16 | supportsVariablePaging = true; 17 | supportsVariableType = true; 18 | }; 19 | }; 20 | 21 | dapLaunchMessage = program: { 22 | command = "launch"; 23 | type = "request"; 24 | arguments = { 25 | MIMode = "gdb"; 26 | arg = [ ]; 27 | cwd = "."; 28 | environment = [ ]; 29 | externalConsole = false; 30 | logging = { }; 31 | miDebuggerPath = "gdb"; 32 | name = "gcc - Build and debug active file"; 33 | inherit program; 34 | request = "launch"; 35 | setupCommands = [ 36 | { 37 | description = "Enable pretty-printing for gdb"; 38 | ignoreFailures = true; 39 | text = "-enable-pretty-printing"; 40 | } 41 | ]; 42 | stopAtEntry = false; 43 | type = "cppdbg"; 44 | }; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /pkgs/modules/vue/default.nix: -------------------------------------------------------------------------------- 1 | { nodejs }: 2 | { pkgs, lib, ... }: 3 | 4 | let 5 | nodepkgs = nodejs.pkgs; 6 | node-version = lib.versions.major nodejs.version; 7 | 8 | vue-language-server = pkgs.callPackage ../../vue-language-server { 9 | inherit nodejs; 10 | }; 11 | 12 | language = "vue"; 13 | extensions = [ ".vue" ".js" ".mjs" ".cjs" ".jsx" ".ts" ".tsx" ".json" ".html" ".css" ]; 14 | in 15 | 16 | { 17 | id = "vue-node-${node-version}"; 18 | name = "Vue Tools with Node.js"; 19 | displayVersion = node-version; 20 | description = '' 21 | Vue.js development tools. Includes Node.js, Bun, pnpm, yarn, Vue language tools. 22 | ''; 23 | 24 | replit = { 25 | packages = [ 26 | pkgs.bun 27 | nodejs 28 | nodepkgs.pnpm 29 | nodepkgs.yarn 30 | ]; 31 | 32 | dev.runners.dev-runner = { 33 | name = "package.json dev script"; 34 | inherit language extensions; 35 | start = "${nodejs}/bin/npm run dev"; 36 | }; 37 | 38 | dev.languageServers.vue-language-server = { 39 | name = "Vue Language Server"; 40 | inherit language extensions; 41 | start = "${vue-language-server}/bin/vue-language-server --stdio"; 42 | 43 | initializationOptions = { 44 | typescript.tsdk = "${nodepkgs.typescript}/lib/node_modules/typescript/lib"; 45 | }; 46 | }; 47 | }; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /pkgs/replbox/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | argparse@^2.0.1: 6 | version "2.0.1" 7 | resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" 8 | integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== 9 | 10 | biwascheme@^0.7.5: 11 | version "0.7.5" 12 | resolved "https://registry.yarnpkg.com/biwascheme/-/biwascheme-0.7.5.tgz#9c69abd7782f644ef547b62c42f62eb59ae19ffc" 13 | integrity sha512-43ZoNvQaQ9vbMbu7Ld0+ff9aqq3fk0jztY0p4fy6UIZUaRAuiK9ulkjtIJG7zRBkD/ZclOGUXbG13SA0jYy2NQ== 14 | dependencies: 15 | optparse "1.0.5" 16 | 17 | optparse@1.0.5: 18 | version "1.0.5" 19 | resolved "https://registry.yarnpkg.com/optparse/-/optparse-1.0.5.tgz#75e75a96506611eb1c65ba89018ff08a981e2c16" 20 | integrity sha1-dedallBmEescZbqJAY/wipgeLBY= 21 | 22 | prettier@^1.18.2: 23 | version "1.19.1" 24 | resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" 25 | integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== 26 | 27 | underscore@1.2.2: 28 | version "1.2.2" 29 | resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.2.2.tgz#74dd40e9face84e724eb2edae945b8aedc233ba3" 30 | integrity sha1-dN1A6frOhOck6y7a6UW4rtwjO6M= 31 | -------------------------------------------------------------------------------- /pkgs/modules/replit/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | # use patched version of taplo to fix schema validation errors causing excessive lsp errors 5 | # specifically, the patch addresses error span issues with unexpected properties in .replit files 6 | # https://github.com/tamasfe/taplo/pull/664 7 | taplo = pkgs.rustPlatform.buildRustPackage { 8 | pname = "taplo"; 9 | version = "0.patched"; 10 | src = pkgs.fetchFromGitHub { 11 | owner = "cdmistman"; 12 | repo = "taplo"; 13 | rev = "only-share-spans-of-unexpected-properties"; 14 | hash = "sha256-1GYmZZlFaa1w3zFfSlM7o4PXwjfKH3YnZbGWzBnobM4="; 15 | }; 16 | 17 | cargoHash = "sha256-ejqrzSam1kuMRYQKV6O/LYTkik3XoO0HDth9N9YqrSI="; 18 | buildFeatures = [ "lsp" ]; 19 | }; 20 | 21 | taplo-config = pkgs.writeText "taplo-config.toml" '' 22 | include = ["**/.replit"] 23 | 24 | [schema] 25 | enabled = true 26 | path = "/etc/replit/dotreplit.schema.json" 27 | ''; 28 | in 29 | 30 | { 31 | id = "replit"; 32 | name = "Base Replit Tools"; 33 | description = '' 34 | Replit tools. Includes .replit language server. 35 | ''; 36 | 37 | replit.env = { 38 | REPLIT_LD_AUDIT = "${pkgs.replit-rtld-loader}/rtld_loader.so"; 39 | }; 40 | 41 | replit.dev.languageServers.dotreplit-lsp = { 42 | name = ".replit LSP"; 43 | language = "dotreplit"; 44 | start = "${taplo}/bin/taplo lsp -c ${taplo-config} stdio"; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /pkgs/upgrade-map/default.nix: -------------------------------------------------------------------------------- 1 | /* 2 | This implements auto-upgrading from one module ID to another at build time, based on the 3 | mapping below. This is here for historical purposes, and we don't expect to use it much, although 4 | there are valid use cases. 5 | */ 6 | with builtins; 7 | let 8 | upgrade-map = { 9 | "bun" = "bun-0.5"; 10 | "bun-0.5" = "bun-0.6"; 11 | "bun-0.6" = "bun-0.7"; 12 | "bun-0.7" = "bun-1.0"; 13 | "dart-3.0" = "dart-3.1"; 14 | "dart-3.1" = "dart-3.2"; 15 | "dart-3.2" = "dart-3.3"; 16 | "dart-3.3" = "dart-3.4"; 17 | "dart-3.4" = "dart-3.5"; 18 | "dart-3.5" = "dart-3.8"; 19 | "elixir-1_16" = "elixir-1_17"; 20 | "elixir-1_17" = "elixir-1_18"; 21 | "go" = "go-1.19"; 22 | "go-1.23" = "go-1.24"; 23 | "r-4.3" = "r-4.4"; 24 | "r-4.4" = "r-4.5"; 25 | "rust" = "rust-1.69"; 26 | "rust-1.69" = "rust-1.70"; 27 | "rust-1.70" = "rust-1.72"; 28 | "rust-1.72" = "rust-stable"; 29 | "swift" = "swift-5.6"; 30 | }; 31 | 32 | upgrade-module = moduleId: 33 | if hasAttr moduleId upgrade-map then 34 | upgrade-module upgrade-map.${moduleId} 35 | else 36 | moduleId; 37 | 38 | apply-upgrade-map = modules: 39 | foldl' 40 | (acc: moduleId: 41 | let upgraded = upgrade-module moduleId; 42 | in acc // { 43 | ${moduleId} = modules.${upgraded}; 44 | } 45 | ) 46 | modules 47 | (attrNames upgrade-map); 48 | in 49 | apply-upgrade-map 50 | -------------------------------------------------------------------------------- /pkgs/modules/docker/replit-buildkit.patch: -------------------------------------------------------------------------------- 1 | diff --git a/cmd/buildkitd/main.go b/cmd/buildkitd/main.go 2 | index 3375c438a..5c8b018ff 100644 3 | --- a/cmd/buildkitd/main.go 4 | +++ b/cmd/buildkitd/main.go 5 | @@ -217,11 +217,7 @@ func main() { 6 | app.Flags = append(app.Flags, serviceFlags()...) 7 | 8 | app.Action = func(c *cli.Context) error { 9 | - // TODO: On Windows this always returns -1. The actual "are you admin" check is very Windows-specific. 10 | - // See https://github.com/golang/go/issues/28804#issuecomment-505326268 for the "short" version. 11 | - if os.Geteuid() > 0 { 12 | - return errors.New("rootless mode requires to be executed as the mapped root in a user namespace; you may use RootlessKit for setting up the namespace") 13 | - } 14 | + // Replit mod: do not perform the rootless detection. 15 | ctx, cancel := context.WithCancel(appcontext.Context()) 16 | defer cancel() 17 | 18 | diff --git a/solver/cachemanager.go b/solver/cachemanager.go 19 | index e5e7e4fb9..1b92f969b 100644 20 | --- a/solver/cachemanager.go 21 | +++ b/solver/cachemanager.go 22 | @@ -176,7 +176,11 @@ func (c *cacheManager) Load(ctx context.Context, rec *CacheRecord) (rres Result, 23 | "stack": bklog.TraceLevelOnlyStack(), 24 | }) 25 | defer func() { 26 | - lg.WithError(rerr).WithField("return_result", rres.ID()).Trace("cache manager") 27 | + rresID := "" 28 | + if rres != nil { 29 | + rresID = rres.ID() 30 | + } 31 | + lg.WithError(rerr).WithField("return_result", rresID).Trace("cache manager") 32 | }() 33 | 34 | c.mu.RLock() 35 | -------------------------------------------------------------------------------- /pkgs/dapPython/wrapper.py: -------------------------------------------------------------------------------- 1 | #!@python-bin@ 2 | """A small wrapper around debugpy's cli. 3 | 4 | This wrapper is roughly equivalent to: 5 | 6 | python3 -m debugpy --listen localhost:0 --wait-for-client "$@" 7 | 8 | with the added twist that it reports the port used back through fd 3. 9 | """ 10 | 11 | import os 12 | import os.path 13 | import sys 14 | import runpy 15 | 16 | # Permit interpolated path to be sensibly replaced. 17 | for idx, path in enumerate("@debugpy-path@".split(":")): 18 | sys.path.insert(idx, path) 19 | 20 | import debugpy 21 | import debugpy.server 22 | 23 | 24 | def _main() -> None: 25 | if len(sys.argv) < 2: 26 | print(f'Usage: {sys.argv[0]}