├── .github ├── CODEOWNERS └── workflows │ └── update-unstable.yml ├── pkgs ├── stderred │ ├── .gitignore │ ├── Cargo.toml │ ├── default.nix │ ├── src │ │ └── main.rs │ └── Cargo.lock ├── node-packages │ ├── readme.md │ ├── node-packages.json │ ├── generate.sh │ ├── default.nix │ └── node-env.nix ├── moduleit │ ├── entrypoint.nix │ ├── default.nix │ ├── README.md │ ├── moduleit.sh │ ├── example.nix │ └── module-definition.nix ├── replbox │ ├── default.nix │ ├── package.json │ ├── yarn.lock │ └── yarn.nix ├── java-debug │ ├── patches │ │ └── repo.diff │ ├── repo.nix │ ├── default.nix │ ├── debug-plugin.nix │ └── java-dap ├── basil │ └── default.nix ├── dapNode │ ├── js-debug │ │ ├── README.md │ │ ├── default.nix │ │ ├── package.json │ │ └── node-env.nix │ └── default.nix ├── nbcode │ ├── vsix.nix │ └── default.nix ├── bun │ └── default.nix ├── rescript-language-server │ └── default.nix ├── pip │ └── default.nix ├── poetry │ ├── default.nix │ └── README.md ├── dap-cpp │ ├── default.nix │ └── messages.nix ├── clang-compile │ └── default.nix ├── python-lsp-server │ └── default.nix ├── dapPython │ └── default.nix ├── phpactor │ └── default.nix ├── processing4 │ └── default.nix └── jdt-language-server │ └── default.nix ├── .gitignore ├── flake.nix ├── default.nix ├── hydra ├── release-21.11.nix ├── release-22.05.nix ├── release-22.11.nix ├── release-23.05.nix ├── release-23.11.nix ├── release-24.05.nix ├── release-24.11.nix ├── release-25.05.nix ├── release-legacy.nix └── release-unstable.nix ├── .semaphore ├── notify-spinnaker.yml ├── push.yml └── semaphore.yml ├── update.sh ├── add.sh ├── LICENSE ├── spin_deploy.sh ├── README.md ├── overlay.nix └── nix ├── sources.json └── sources.nix /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @replit/devex -------------------------------------------------------------------------------- /pkgs/stderred/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | result-* 3 | 4 | *.sw[lmnop] 5 | 6 | nixpkgs-*.tar.gz 7 | -------------------------------------------------------------------------------- /pkgs/node-packages/readme.md: -------------------------------------------------------------------------------- 1 | Add additional packages to the node overlay in `node-packages.json`. Build an 2 | updated package with `./generate`. 3 | -------------------------------------------------------------------------------- /pkgs/node-packages/node-packages.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "coffeescript": "2.6.1" }, 3 | { "jest-cli": "23.6.0" }, 4 | { "ts-node": "10.4.0" }, 5 | { "typescript-language-server": "3.3.2" } 6 | ] 7 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | outputs = 3 | { self }: 4 | let 5 | system = "x86_64-linux"; 6 | in 7 | { 8 | legacyPackages.${system} = import ./. { inherit system; }; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/node-packages/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | nix-shell -p nodePackages.node2nix --run 'node2nix -14 --version' 3 | nix-shell -p nodePackages.node2nix --run 'node2nix -14 -i node-packages.json' 4 | nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt .' 5 | 6 | -------------------------------------------------------------------------------- /pkgs/moduleit/entrypoint.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import { } 2 | , configPath 3 | }: 4 | 5 | (pkgs.lib.evalModules { 6 | modules = [ 7 | configPath 8 | (import ./module-definition.nix) 9 | ]; 10 | specialArgs = { 11 | inherit pkgs; 12 | modulesPath = builtins.toString ./.; 13 | }; 14 | }).config.replit.buildModule 15 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { sources ? import nix/sources.nix 2 | , channelName ? "nixpkgs-25.05" 3 | , channel ? sources.${channelName} 4 | , system ? "x86_64-linux" 5 | , config ? { } 6 | }: 7 | let 8 | overlay = (import ./overlay.nix) { 9 | inherit sources channelName; 10 | }; 11 | in 12 | import channel { inherit config system; overlays = [ overlay ]; } 13 | -------------------------------------------------------------------------------- /hydra/release-21.11.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-21.11"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-22.05.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-22.05"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-22.11.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-22.11"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-23.05.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-23.05"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-23.11.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-23.11"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-24.05.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-24.05"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-24.11.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-24.11"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-25.05.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources."nixpkgs-25.05"; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-legacy.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources.nixpkgs-legacy; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /hydra/release-unstable.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | sources = import ../nix/sources.nix; 5 | pkgs = import ../default.nix { 6 | sources = sources; 7 | channel = sources.nixpkgs-unstable; 8 | }; 9 | in 10 | { 11 | inherit (pkgs) replitPackages; 12 | inherit (pkgs.nodePackages) typescript-language-server yarn prettier svelte-language-server; 13 | } 14 | -------------------------------------------------------------------------------- /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 = "3.1", features = ["derive"] } 12 | itertools = "0.10" 13 | memmap = "0.7" 14 | nix = "0.23" 15 | xmas-elf = "0.8" 16 | -------------------------------------------------------------------------------- /.semaphore/notify-spinnaker.yml: -------------------------------------------------------------------------------- 1 | version: v1.0 2 | name: deploy 3 | agent: 4 | machine: 5 | type: e1-standard-2 6 | os_image: ubuntu2004 7 | auto_cancel: 8 | running: 9 | when: branch != 'master' 10 | blocks: 11 | - name: Notify spinnaker 12 | task: 13 | secrets: 14 | - name: replit-nixpkgs-semaphore 15 | jobs: 16 | - name: Notify spinnaker 17 | commands: 18 | - checkout 19 | - ./spin_deploy.sh 20 | -------------------------------------------------------------------------------- /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/stderred/default.nix: -------------------------------------------------------------------------------- 1 | { rustPlatform, stderred, makeWrapper }: 2 | 3 | rustPlatform.buildRustPackage { 4 | pname = "stderred"; 5 | version = "0.1.0"; 6 | 7 | src = builtins.path { path = ./.; name = "stderred"; }; 8 | 9 | cargoSha256 = "sha256-ixJY/O6pE1YJ08GJY4kZ4RaDf+1s17satbOhyBEjyuQ="; 10 | 11 | nativeBuildInputs = [ makeWrapper ]; 12 | 13 | postInstall = '' 14 | wrapProgram "$out/bin/stderred" \ 15 | --set STDERRED_PATH ${stderred}/lib/libstderred.so 16 | ''; 17 | } 18 | -------------------------------------------------------------------------------- /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/basil/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , python3 3 | , fetchFromGitHub 4 | }: 5 | stdenv.mkDerivation rec { 6 | name = "basil"; 7 | 8 | src = fetchFromGitHub { 9 | owner = "basilTeam"; 10 | repo = "basil"; 11 | rev = "575b4590d45144f80d74ddc0bfc133cad4b7c04d"; 12 | sha256 = "sha256:0s0mk5l4xd4y96q1mdx12cgm99n9r85xqyrgc5i8jx0bhfpjbdpm"; 13 | }; 14 | 15 | buildPhase = '' 16 | ${python3}/bin/python3 build.py basil-release 17 | ''; 18 | 19 | installPhase = '' 20 | mkdir -p $out 21 | cp -r bin $out 22 | ''; 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/dapNode/js-debug/README.md: -------------------------------------------------------------------------------- 1 | # js-debug Package 2 | 3 | This Nix package installs and builds the DAP server in 4 | https://github.com/replit/vscode-js-debug. 5 | 6 | The `.nix` files were generated using [node2nix](https://github.com/svanderburg/node2nix) by the command: 7 | 8 | ``` 9 | node2nix -d 10 | ``` 11 | 12 | which uses the `package.json` file as input, which was grabbed from https://github.com/replit/vscode-js-debug 13 | at rev 5eac5f8255cd61b238547a7b383a00b971e223da, then removing the playwright package as I couldn't 14 | get that to build. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pkgs/nbcode/vsix.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , unzip 3 | , fetchurl 4 | }: 5 | stdenv.mkDerivation { 6 | name = "nbcode-vsix"; 7 | version = "12.6.301"; 8 | 9 | src = fetchurl { 10 | url = "https://asf.gallery.vsassets.io/_apis/public/gallery/publisher/asf/extension/apache-netbeans-java/12.6.301/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage"; 11 | sha256 = "0iaqp953zgmnvbphzs8l2pjmfdrcy2m6rir1d2briniy37a350qf"; 12 | }; 13 | 14 | unpackCmd = "${unzip}/bin/unzip $curSrc -d ./build"; 15 | dontConfigure = true; 16 | dontBuild = true; 17 | installPhase = "cp -a extension/nbcode $out"; 18 | } 19 | -------------------------------------------------------------------------------- /pkgs/dapNode/js-debug/default.nix: -------------------------------------------------------------------------------- 1 | # This file has been generated by node2nix 1.11.1. Do not edit! 2 | 3 | { pkgs ? import { 4 | inherit system; 5 | } 6 | , system ? builtins.currentSystem 7 | , nodejs ? pkgs."nodejs-14_x" 8 | }: 9 | 10 | let 11 | nodeEnv = import ./node-env.nix { 12 | inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; 13 | inherit pkgs nodejs; 14 | libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; 15 | }; 16 | in 17 | import ./node-packages.nix { 18 | inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; 19 | inherit nodeEnv; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/node-packages/default.nix: -------------------------------------------------------------------------------- 1 | # This file has been generated by node2nix 1.11.1. Do not edit! 2 | 3 | { pkgs ? import { 4 | inherit system; 5 | } 6 | , system ? builtins.currentSystem 7 | , nodejs ? pkgs."nodejs-14_x" 8 | }: 9 | 10 | let 11 | nodeEnv = import ./node-env.nix { 12 | inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; 13 | inherit pkgs nodejs; 14 | libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; 15 | }; 16 | in 17 | import ./node-packages.nix { 18 | inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; 19 | inherit nodeEnv; 20 | } 21 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | nix-shell -p niv --run 'niv update nixpkgs-unstable -b nixpkgs-unstable' 3 | nix-shell -p niv --run 'niv update nixpkgs-21.11 -b nixos-21.11' 4 | nix-shell -p niv --run 'niv update nixpkgs-22.05 -b nixos-22.05' 5 | nix-shell -p niv --run 'niv update nixpkgs-22.11 -b nixos-22.11' 6 | nix-shell -p niv --run 'niv update nixpkgs-23.05 -b nixos-23.05' 7 | nix-shell -p niv --run 'niv update nixpkgs-23.11 -b nixos-23.11' 8 | nix-shell -p niv --run 'niv update nixpkgs-24.05 -b nixos-24.05' 9 | nix-shell -p niv --run 'niv update nixpkgs-24.11 -b nixos-24.11' 10 | nix-shell -p niv --run 'niv update nixpkgs-25.05 -b nixos-25.05' 11 | -------------------------------------------------------------------------------- /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/nbcode/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , graalvm11-ce 3 | , makeWrapper 4 | , callPackage 5 | }: 6 | let 7 | nbcode-vsix = callPackage ./vsix.nix { }; 8 | 9 | in 10 | stdenv.mkDerivation { 11 | name = "nbcode"; 12 | 13 | nativeBuildInputs = [ nbcode-vsix graalvm11-ce makeWrapper ]; 14 | 15 | unpackPhase = "true"; 16 | dontBuild = true; 17 | 18 | installPhase = '' 19 | makeWrapper ${nbcode-vsix}/bin/nbcode $out/bin/java-lsp \ 20 | --add-flags "--jdkhome ${graalvm11-ce}" \ 21 | --add-flags "--start-java-language-server=stdio" 22 | 23 | makeWrapper ${nbcode-vsix}/bin/nbcode $out/bin/java-dap \ 24 | --add-flags "--jdkhome ${graalvm11-ce}" \ 25 | --add-flags "--start-java-debug-adapter-server=stdio" 26 | ''; 27 | } 28 | -------------------------------------------------------------------------------- /.semaphore/push.yml: -------------------------------------------------------------------------------- 1 | version: v1.0 2 | name: deploy 3 | agent: 4 | machine: 5 | type: e1-standard-2 6 | os_image: ubuntu2004 7 | auto_cancel: 8 | running: 9 | when: branch != 'master' 10 | blocks: 11 | - name: Push overlay tarballs 12 | task: 13 | secrets: 14 | - name: replit-nixpkgs-semaphore 15 | prologue: 16 | commands: 17 | - gcloud auth activate-service-account --key-file=.secrets.gcp.json 18 | - checkout 19 | jobs: 20 | - name: Make and upload tarballs 21 | commands: 22 | - ./build.sh $NIXPKGS_CHANNEL 23 | - gsutil cp $NIXPKGS_CHANNEL.tar.gz gs://replit-nixpkgs/$NIXPKGS_CHANNEL.tar.gz 24 | - gsutil acl ch -u AllUsers:R gs://replit-nixpkgs/$NIXPKGS_CHANNEL.tar.gz 25 | -------------------------------------------------------------------------------- /add.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | channel=$1 3 | 4 | # Add the channel to the overlay 5 | nix-shell -p niv --run "niv add nixos/nixpkgs --name nixpkgs-$channel -b nixos-$channel" 6 | 7 | # Add the channel to the update script 8 | echo "nix-shell -p niv --run 'niv update nixpkgs-$channel -b nixos-$channel'" >> update.sh 9 | 10 | # Add the channel to hydra 11 | cp hydra/release-21.11.nix hydra/release-$channel.nix 12 | sed -i "s/21\.11/$channel/g" hydra/release-$channel.nix 13 | 14 | # Add the channel to semaphore 15 | sed -i "s/^\(.*\)nixpkgs-unstable/\1nixpkgs-$channel\n&/" .semaphore/semaphore.yml 16 | sed -i "s/^\(.*\)nixpkgs-unstable/\1nixpkgs-$channel\n&/" .semaphore/push.yml 17 | 18 | git add \ 19 | nix/sources.json \ 20 | update.sh \ 21 | hydra/release-$channel.nix \ 22 | .semaphore/semaphore.yml \ 23 | .semaphore/push.yml 24 | -------------------------------------------------------------------------------- /pkgs/bun/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenvNoCC 3 | , callPackage 4 | , fetchurl 5 | , autoPatchelfHook 6 | , unzip 7 | , openssl 8 | , writeShellScript 9 | , curl 10 | , jq 11 | , common-updater-scripts 12 | }: 13 | 14 | stdenvNoCC.mkDerivation { 15 | version = "0.5.9"; 16 | pname = "bun"; 17 | 18 | src = fetchurl { 19 | url = "https://github.com/oven-sh/bun/releases/download/bun-v0.5.9/bun-linux-x64.zip"; 20 | sha256 = "vwxkydYJdnb8MBUAfywpXdaahsuw5IvnXeoUmilzruE="; 21 | }; 22 | 23 | strictDeps = true; 24 | nativeBuildInputs = [ unzip ] ++ lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ]; 25 | buildInputs = [ openssl ]; 26 | 27 | dontConfigure = true; 28 | dontBuild = true; 29 | 30 | installPhase = '' 31 | runHook preInstall 32 | install -Dm 755 ./bun $out/bin/bun 33 | runHook postInstall 34 | ''; 35 | } 36 | -------------------------------------------------------------------------------- /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/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 | 17 | unpackPhase = "true"; 18 | dontBuild = true; 19 | 20 | nativeBuildInputs = [ python3 ]; 21 | buildInputs = [ makeWrapper ]; 22 | installPhase = '' 23 | mkdir -p $out/bin 24 | cp ${./java-dap} $out/bin/java-dap 25 | patchShebangs $out/bin/java-dap 26 | 27 | makeWrapper $out/bin/java-dap $out/bin/java-debug \ 28 | --add-flags --use-ephemeral-port \ 29 | --add-flags --debug-plugin \ 30 | --add-flags ${debug-plugin}/lib/java-debug.jar \ 31 | --add-flags --language-server \ 32 | --add-flags ${jdt-language-server}/bin/jdt-language-server 33 | ''; 34 | } 35 | -------------------------------------------------------------------------------- /pkgs/rescript-language-server/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , fetchurl 3 | , nodejs 4 | , unzip 5 | , makeWrapper 6 | }: 7 | 8 | stdenv.mkDerivation rec { 9 | pname = "rescript-lang-server"; 10 | version = "1.1.3"; 11 | 12 | src = fetchurl { 13 | url = "https://github.com/rescript-lang/rescript-vscode/releases/download/${version}/rescript-vscode-${version}.vsix"; 14 | sha256 = "0zahvyxxqs7q6k7p81bzq59jzbkiikp1vkpxpgfy6c35cj4kww5r"; 15 | }; 16 | 17 | buildInputs = [ 18 | nodejs 19 | ]; 20 | 21 | nativeBuildInputs = [ 22 | unzip 23 | makeWrapper 24 | ]; 25 | 26 | unpackCmd = "unzip $curSrc"; 27 | 28 | installPhase = '' 29 | mkdir -p $out/share 30 | cp -r ./ $out/share 31 | 32 | makeWrapper ${nodejs}/bin/node $out/bin/rescript-language-server \ 33 | --run "cd $out/share" \ 34 | --add-flags "./server/out/server.js" \ 35 | --add-flags "--stdio" 36 | ''; 37 | } 38 | -------------------------------------------------------------------------------- /pkgs/pip/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | pkgs.python310Packages.buildPythonPackage rec { 3 | pname = "pip"; 4 | version = "21.2.dev0"; 5 | format = "other"; 6 | 7 | src = pkgs.fetchFromGitHub { 8 | owner = "replit"; 9 | repo = pname; 10 | rev = "main"; 11 | sha256 = "sha256-k4RnK9TnvfJlxpihdHFg3JmYtNDC4KY+f41VwJ+e+1A="; 12 | name = "${pname}-${version}-source"; 13 | }; 14 | 15 | nativeBuildInputs = [ pkgs.python310Packages.bootstrapped-pip ]; 16 | 17 | # pip detects that we already have bootstrapped_pip "installed", so we need 18 | # to force it a little. 19 | pipInstallFlags = [ "--ignore-installed" ]; 20 | 21 | # Pip wants pytest, but tests are not distributed 22 | doCheck = false; 23 | 24 | meta = { 25 | description = "The PyPA recommended tool for installing Python packages"; 26 | license = with pkgs.lib.licenses; [ mit ]; 27 | homepage = "https://github.com/replit/pip"; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /pkgs/moduleit/moduleit.sh: -------------------------------------------------------------------------------- 1 | if [ $# -eq 0 ]; then 2 | echo "Please provide a module file argument" 3 | exit 1 4 | fi 5 | 6 | MODULE_FILE="$1" 7 | OUTPUT_FILE="$2" 8 | 9 | MODULE_FILE_ABSOLUTE_PATH="$(realpath $MODULE_FILE)" 10 | SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" 11 | ENTRYPOINT_PATH="$SCRIPT_DIR/entrypoint.nix" 12 | 13 | args=("$ENTRYPOINT_PATH" --argstr configPath "$MODULE_FILE_ABSOLUTE_PATH") 14 | 15 | if [ ! -z "${OUTPUT_FILE}" ]; then 16 | args+=(--out-link "${OUTPUT_FILE}") 17 | 18 | if [[ -f "${OUTPUT_FILE}" ]]; then 19 | rm -f "${OUTPUT_FILE}" 20 | fi 21 | fi 22 | 23 | echo "nix-build ${args[@]}" 24 | nix-build "${args[@]}" 25 | 26 | if [ -L "${OUTPUT_FILE}" ]; then 27 | # If output link was provided, 28 | # materialize the output as an actual file containing the JSON config 29 | # instead of a symlink 30 | cp --remove-destination "$(realpath "${OUTPUT_FILE}")" "${OUTPUT_FILE}" 31 | fi 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pkgs/poetry/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | let 3 | python = pkgs.python310Full; 4 | 5 | myPoetry = pkgs.stdenv.mkDerivation { 6 | name = "poetry-in-venv"; 7 | version = "1.1.13"; 8 | 9 | src = builtins.fetchTarball { 10 | url = https://storage.googleapis.com/poetry-bundles/poetry-1.1.13-bundle.tgz; 11 | sha256 = "sha256:0f9vwqjl4lk8mx12b20q563mr9zn00pgbnnhmrwmjgz787x26m75"; 12 | }; 13 | 14 | buildInputs = [ pkgs.python310Packages.pip ]; 15 | 16 | installPhase = '' 17 | mkdir -p $out/bin 18 | ${python}/bin/python3 -m venv $out/env 19 | touch $out/env/poetry_env # This allows poetry to recognize it 20 | # https://github.com/replit/poetry/blob/replit-1.1/poetry/utils/env.py#L885 21 | # invoking the workaround so that poetry 22 | # does not use its own venv for the project 23 | # env 24 | $out/env/bin/pip install poetry --find-links ./ --no-index 25 | ln -s $out/env/bin/poetry $out/bin/poetry 26 | ''; 27 | }; 28 | in 29 | myPoetry 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2021 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/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/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 | -------------------------------------------------------------------------------- /spin_deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -evxo pipefail 4 | 5 | cache restore "nixpkgs-last-successful-sha" 6 | 7 | LAST_SHA=$(cat "nixpkgs-last-successful-sha" || echo "$SEMAPHORE_GIT_SHA") 8 | SHA_SHORT=$(git rev-parse --short=8 "$SEMAPHORE_GIT_SHA") 9 | AUTHOR_EMAIL=$(git show -s --format='%ae' "$SEMAPHORE_GIT_SHA") 10 | ALL_AUTHORS=$(git log --format="%ae" "$LAST_SHA".."$SEMAPHORE_GIT_SHA" | sort | uniq | paste -sd "," -) 11 | 12 | cat <payload.json 13 | { 14 | "url": "webhooks/webhook/nixpkgs-replit", 15 | "method": "POST", 16 | "body": { 17 | "secret": "$SPIN_SECRET", 18 | "parameters": { 19 | "sha": "$SEMAPHORE_GIT_SHA", 20 | "sha_range": "$LAST_SHA...$SEMAPHORE_GIT_SHA", 21 | "sha_short": "$SHA_SHORT", 22 | "last_author": "$AUTHOR_EMAIL", 23 | "all_authors": "$ALL_AUTHORS", 24 | "rollback_pipeline": "webhooks/webhook/nixpkgs-replit-rollback", 25 | "scratch": "false" 26 | } 27 | } 28 | } 29 | EOF 30 | 31 | curl --fail -X POST \ 32 | -H "$WEBHOOK_AUTH" \ 33 | -H "content-type: application/json" \ 34 | -d @payload.json \ 35 | "$WEBHOOK_URL" 36 | 37 | git rev-parse --verify "$SEMAPHORE_GIT_SHA" >"nixpkgs-last-successful-sha" 38 | cache delete "nixpkgs-last-successful-sha" 39 | cache store "nixpkgs-last-successful-sha" "nixpkgs-last-successful-sha" 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.github/workflows/update-unstable.yml: -------------------------------------------------------------------------------- 1 | name: update unstable 2 | 3 | on: 4 | schedule: 5 | - cron: "0 8 * * 1" 6 | 7 | jobs: 8 | update-unstable: 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: niv update 18 | run: nix run nixpkgs#niv -- update nixpkgs-unstable 19 | 20 | - name: open PR 21 | uses: peter-evans/create-pull-request@v5 22 | with: 23 | commit-message: update nixpkgs-unstable 24 | branch: actions/update-nixpkgs-unstable 25 | title: Update nixpkgs-unstable 26 | body: >- 27 | # Why 28 | 29 | Users should have the latest and greatest nixpkgs-unstable 30 | available to them for use on Replit. 31 | 32 | # What Changed 33 | 34 | Updated the unstable channel by running 35 | `nix run nixpkgs#niv -- update nixpkgs-unstable`. 36 | 37 | # Notes 38 | 39 | See https://github.com/replit/goval/blob/main/docs/nix-cache.md 40 | for more information on updating the Nix cache. 41 | 42 | This PR is created via a GitHub Actions Workflow. Please 43 | take care to ensure its contents are correct. This Workflow 44 | runs every month to ensure the Replit nix cache is regularly 45 | updated. 46 | -------------------------------------------------------------------------------- /pkgs/clang-compile/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, clang }: 2 | pkgs.writeShellScriptBin "clang-compile" '' 3 | FILE="$1" # a .c or .cpp file 4 | LANG="$2" # lang can be: 5 | # c - C 6 | # cpp - C++ 7 | MODE="$3" # mode can be: 8 | # single - compile just one .c file, or 9 | # all - compile all .c files 10 | DEBUG="$4" # debug can be: 11 | # debug - compile with no optimization 12 | # (empty) - compile regularly 13 | 14 | if [[ ! -f "$FILE" ]]; then 15 | echo "$FILE not found" 16 | exit 1 17 | fi 18 | 19 | if [[ "$MODE" == "all" ]]; then 20 | if [[ "$LANG" == "c" ]]; then 21 | SRCS=$(find . -name '.ccls-cache' -type d -prune -o -type f -name '*.c' -print) 22 | elif [[ "$LANG" == "cpp" ]]; then 23 | SRCS=$(find . -name '.ccls-cache' -type d -prune -o -type f -name '*.cpp' -print) 24 | else 25 | echo "Invalid LANG parameter: $LANG" 26 | exit 1 27 | fi 28 | else 29 | SRCS="$FILE" 30 | fi 31 | 32 | CFLAGS="$CFLAGS -g -Wno-everything -pthread -lm" 33 | if [[ "$DEBUG" == "debug" ]]; then 34 | CFLAGS="$CFLAGS -O0" 35 | fi 36 | 37 | if [[ "$LANG" == "c" ]]; then 38 | COMPILER="${clang}/bin/clang" 39 | elif [[ "$LANG" == "cpp" ]]; then 40 | COMPILER="${clang}/bin/clang++" 41 | else 42 | echo "Invalid LANG parameter: $LANG" 43 | exit 1 44 | fi 45 | 46 | rm -f ''$FILE.bin 47 | set -o xtrace 48 | $COMPILER $CFLAGS $SRCS -o "''$FILE.bin" 49 | '' 50 | -------------------------------------------------------------------------------- /pkgs/dapNode/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | let 3 | nodeDependencies = (pkgs.callPackage ./js-debug { }).nodeDependencies.overrideAttrs (previousAttrs: { 4 | buildInputs = with pkgs; previousAttrs.buildInputs ++ [ 5 | nodePackages.node-gyp-build 6 | nodePackages.node-gyp 7 | pkg-config 8 | libsecret 9 | ]; 10 | }); 11 | 12 | js-debug = pkgs.stdenv.mkDerivation { 13 | name = "js-debug"; 14 | version = "1.77.2"; 15 | 16 | src = pkgs.fetchFromGitHub { 17 | owner = "replit"; 18 | repo = "vscode-js-debug"; 19 | rev = "5eac5f8255cd61b238547a7b383a00b971e223da"; 20 | sha256 = "sha256-XvK0r84GLwMZPhPm8IaF1+qVS/WFYkYhj2eqHqM9qlg="; 21 | }; 22 | 23 | buildInputs = [ pkgs.nodejs ]; 24 | 25 | installPhase = 26 | let nodeEscaped = builtins.replaceStrings [ "/" "-" "." ] [ "\\/" "\\-" "\\." ] pkgs.nodejs.outPath; 27 | in 28 | '' 29 | mkdir -p $out/bin 30 | ln -s ${nodeDependencies}/lib/node_modules ./node_modules 31 | ln -s ${nodeDependencies}/lib/node_modules $out/node_modules 32 | ./node_modules/.bin/gulp 33 | ./node_modules/.bin/gulp debugServerMain:webpack-bundle 34 | 35 | cp -r ./dist $out/dist 36 | 37 | # Add shebang... 38 | # Wrapping debugServerMain.js in a sh script doesn't work because it needs to read from 39 | # a pipe directly from the parent (debugproxy) 40 | printf "#!${nodeEscaped}\/bin\/node\n" | cat - $out/dist/src/debugServerMain.js > $out/dist/src/dap-node 41 | 42 | chmod u+x $out/dist/src/dap-node 43 | ln -s $out/dist/src/dap-node $out/bin/dap-node 44 | ''; 45 | }; 46 | in 47 | js-debug 48 | -------------------------------------------------------------------------------- /pkgs/python-lsp-server/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | let pypkgs = pkgs.python310Packages; 3 | in 4 | pypkgs.buildPythonPackage rec { 5 | pname = "python-lsp-server"; 6 | version = "1.15.9"; 7 | format = "pyproject"; 8 | 9 | src = pkgs.fetchFromGitHub { 10 | owner = "replit"; 11 | repo = "python-lsp-server"; 12 | rev = "develop"; 13 | hash = "sha256-DUs01BYTrlwmRt+sMeCGnIHV9NSS2m3XLkXAfaQ/Xxw="; 14 | }; 15 | 16 | SETUPTOOLS_SCM_PRETEND_VERSION = version; 17 | 18 | postPatch = '' 19 | substituteInPlace pyproject.toml \ 20 | --replace "--cov-report html --cov-report term --junitxml=pytest.xml" "" \ 21 | --replace "--cov pylsp --cov test" "" 22 | ''; 23 | 24 | pythonRelaxDeps = [ 25 | "autopep8" 26 | "flake8" 27 | "mccabe" 28 | "pycodestyle" 29 | "pydocstyle" 30 | "pyflakes" 31 | ]; 32 | 33 | nativeBuildInputs = [ 34 | pypkgs.pythonRelaxDepsHook 35 | pypkgs.setuptools-scm 36 | ]; 37 | 38 | propagatedBuildInputs = with pypkgs; [ 39 | docstring-to-markdown 40 | jedi 41 | pluggy 42 | python-lsp-jsonrpc 43 | setuptools # `pkg_resources`imported in pylsp/config/config.py 44 | ujson 45 | autopep8 46 | flake8 47 | mccabe 48 | pycodestyle 49 | pydocstyle 50 | pyflakes 51 | pylint 52 | rope 53 | toml 54 | whatthepatch 55 | yapf 56 | pyflakes 57 | rope 58 | ]; 59 | 60 | doCheck = false; 61 | 62 | pythonImportsCheck = [ 63 | "pylsp" 64 | "pylsp.python_lsp" 65 | ]; 66 | 67 | meta = with pkgs.lib; { 68 | description = "Python implementation of the Language Server Protocol"; 69 | homepage = "https://github.com/replit/python-lsp-server"; 70 | license = licenses.mit; 71 | }; 72 | } 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nixpkgs-replit 2 | 3 | `nixpkgs-replit` is Replit's nixpkgs overlay. This overlay provides several 4 | [channels](https://nixos.wiki/wiki/Nix_channels) that track the upstream nix 5 | channels of the same name. 6 | 7 | ## Using the overlay 8 | You can use this overlay by creating any new repl on 9 | [Replit](https://replit.com/new/nix). If you would like to use it locally, you 10 | can add it as a channel. 11 | 12 | ``` 13 | nix-channel --add https://storage.googleapis.com/replit-nixpkgs/nixpkgs-21.11.tar.gz replit-nixpkgs 14 | nix-channel --update 15 | nix-shell -E "import {}" -A replitPackages.replbox 16 | ``` 17 | 18 | ## Building the overlay 19 | You can build packages out of the overlay with the `nix-build` command. The 20 | resulting package will be placed in the `result` directory for testing. 21 | 22 | ``` 23 | # Build the replbox common interpreter frontend 24 | nix-build -A replitPackages.replbox 25 | ``` 26 | 27 | You can also fork [this repl](https://replit.com/@ZachAtReplit/overlay), which 28 | contains the overlay repository, and allows testing packages from the overlay 29 | directly in `replit.nix`. 30 | 31 | ## Building the overlay for a particular channel 32 | 33 | You can build a package for a particular channel like this: 34 | 35 | ``` 36 | nix-build --argstr channelName nixpkgs-22.11 -A nodePackages.typescript-language-server 37 | ``` 38 | 39 | ## Updating the overlay base 40 | You can update the pinned base channels by running `./update.sh`. The update 41 | script will use niv to update the pinned channels to the latest revisions 42 | according to nixpkgs. 43 | 44 | ## Adding a new base channel 45 | You can add additional channels by running `./add.sh `. For example 46 | `./add.sh 22.05` to add the `release-22.05` branch. 47 | 48 | -------------------------------------------------------------------------------- /pkgs/replbox/yarn.nix: -------------------------------------------------------------------------------- 1 | { fetchurl, fetchgit, linkFarm, runCommand, gnutar }: rec { 2 | offline_cache = linkFarm "offline" packages; 3 | packages = [ 4 | { 5 | name = "argparse___argparse_2.0.1.tgz"; 6 | path = fetchurl { 7 | name = "argparse___argparse_2.0.1.tgz"; 8 | url = "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz"; 9 | sha512 = "8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="; 10 | }; 11 | } 12 | { 13 | name = "biwascheme___biwascheme_0.7.5.tgz"; 14 | path = fetchurl { 15 | name = "biwascheme___biwascheme_0.7.5.tgz"; 16 | url = "https://registry.yarnpkg.com/biwascheme/-/biwascheme-0.7.5.tgz"; 17 | sha512 = "43ZoNvQaQ9vbMbu7Ld0+ff9aqq3fk0jztY0p4fy6UIZUaRAuiK9ulkjtIJG7zRBkD/ZclOGUXbG13SA0jYy2NQ=="; 18 | }; 19 | } 20 | { 21 | name = "optparse___optparse_1.0.5.tgz"; 22 | path = fetchurl { 23 | name = "optparse___optparse_1.0.5.tgz"; 24 | url = "https://registry.yarnpkg.com/optparse/-/optparse-1.0.5.tgz"; 25 | sha1 = "dedallBmEescZbqJAY/wipgeLBY="; 26 | }; 27 | } 28 | { 29 | name = "prettier___prettier_1.19.1.tgz"; 30 | path = fetchurl { 31 | name = "prettier___prettier_1.19.1.tgz"; 32 | url = "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz"; 33 | sha512 = "s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew=="; 34 | }; 35 | } 36 | { 37 | name = "underscore___underscore_1.2.2.tgz"; 38 | path = fetchurl { 39 | name = "underscore___underscore_1.2.2.tgz"; 40 | url = "https://registry.yarnpkg.com/underscore/-/underscore-1.2.2.tgz"; 41 | sha1 = "dN1A6frOhOck6y7a6UW4rtwjO6M="; 42 | }; 43 | } 44 | ]; 45 | } 46 | -------------------------------------------------------------------------------- /pkgs/dapPython/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, coreutils }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "replit-python-dap-wrapper"; 5 | version = "1.0.0"; 6 | 7 | phases = "installPhase"; 8 | 9 | # TODO: this has an implicit dependency on python and the pydebug package. 10 | 11 | buildInputs = [ coreutils ]; 12 | 13 | installPhase = '' 14 | mkdir -p $out/bin 15 | 16 | cat< $out/bin/dap-python 17 | #!${coreutils}/bin/env python3 18 | """A small wrapper around debugpy's cli. 19 | 20 | This wrapper is roughly equivalent to: 21 | 22 | python3 -m debugpy --listen localhost:0 --wait-for-client "$@" 23 | 24 | with the added twist that it reports the port used back through fd 3. 25 | """ 26 | 27 | import os 28 | import os.path 29 | import sys 30 | import runpy 31 | 32 | import debugpy 33 | import debugpy.server 34 | 35 | 36 | def _main() -> None: 37 | if len(sys.argv) < 2: 38 | print(f'Usage: {sys.argv[0]}