diff --git a/README.md b/README.md index dd593d33..204bf039 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,9 @@ or ``` nix build .#custom-bundle-squashfs ``` + +## Adding modules to historical modules + +pkgs/historical-modules/default.nix provides a list of modules that are still active but we no longer maintain and build. + +To add a new historical module, you need to pick a commit of the nix modules repo that has that module in it. This commit's src code will be used to build this module. diff --git a/flake.lock b/flake.lock index 61ca6a6c..1dad8d71 100644 --- a/flake.lock +++ b/flake.lock @@ -48,11 +48,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1728282832, - "narHash": "sha256-I7AbcwGggf+CHqpyd/9PiAjpIBGTGx5woYHqtwxaV7I=", + "lastModified": 1728455642, + "narHash": "sha256-abYGwrL6ak5sBRqwPh+V3CPJ6Pa89p378t51b7BO1lE=", "owner": "nix-community", "repo": "fenix", - "rev": "1ec71be1f4b8f3105c5d38da339cb061fefc43f4", + "rev": "3b47535a5c782e4f4ad59cd4bdb23636b6926e03", "type": "github" }, "original": { @@ -169,11 +169,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1723948777, - "narHash": "sha256-rX14joTzvRUiCfmCT0LUMV3Mxi79VJANcKB/kkh7Qys=", + "lastModified": 1726716330, + "narHash": "sha256-mIuOP4I51eFLquRaxMKx67pHmhatZrcVPjfHL98v/M8=", "owner": "oxalica", "repo": "nil", - "rev": "4f3081d1f10bb61f197b780e67f426e53f818691", + "rev": "c8e8ce72442a164d89d3fdeaae0bcc405f8c015a", "type": "github" }, "original": { @@ -200,11 +200,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1725503534, - "narHash": "sha256-hd1eRyPtTkRnAPYpnEfzugQwAifVYMmOR3z+MTTSw+g=", + "lastModified": 1728409405, + "narHash": "sha256-kk530XBUGDpt0DQbyUb3yDpSddPqF9PA5KTo/nsmmg0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fcb54ddcc974cff59bdfb7c1ac9e080299763d2d", + "rev": "1366d1af8f58325602280e43ed6233849fb92216", "type": "github" }, "original": { @@ -270,11 +270,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1728249780, - "narHash": "sha256-J269DvCI5dzBmPrXhAAtj566qt0b22TJtF3TIK+tMsI=", + "lastModified": 1728386838, + "narHash": "sha256-Lk64EoJkvp3WMGVJK3CR1TYcNghX0/BqHPLW5zdvmLE=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "2b750da1a1a2c1d2c70896108d7096089842d877", + "rev": "efaf8bd5de34e2f47bd57425b83e0c7974902176", "type": "github" }, "original": { @@ -292,11 +292,11 @@ ] }, "locked": { - "lastModified": 1722824458, - "narHash": "sha256-2k3/geD5Yh8JT1nrGaRycje5kB0DkvQA/OUZoel1bIU=", + "lastModified": 1726453838, + "narHash": "sha256-pupsow4L79SBfNwT6vh/5RAbVZuhngIA0RTCZksXmZY=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a8a937c304e62a5098c6276c9cdf65c19a43b1a5", + "rev": "ca2e79cd22625d214b8437c2c4080ce79bd9f7d2", "type": "github" }, "original": { @@ -357,11 +357,11 @@ ] }, "locked": { - "lastModified": 1724710535, - "narHash": "sha256-iw6I7yhXBbanIUi3VHXIveXDXF9BrakwAflQ76/pxDg=", + "lastModified": 1726178208, + "narHash": "sha256-WppAdNVzhB79d4BtkzpqDBruw/XhGtw7Ra6qqHE4vPs=", "owner": "replit", "repo": "ztoc-rs", - "rev": "977661eba22f474a9fddd1ff1fcd63b6acadc902", + "rev": "94a02a9a2e51dff2ecb6791e27f7ad5983ba9a28", "type": "github" }, "original": { diff --git a/pkgs/historical-modules/default.nix b/pkgs/historical-modules/default.nix index 455388d0..00403f17 100644 --- a/pkgs/historical-modules/default.nix +++ b/pkgs/historical-modules/default.nix @@ -78,6 +78,15 @@ let displayVersion = "1.20"; }; } + { + moduleId = "go-1.21"; + commit = "00fa9ccbbd30ded08a8ab54259490102f21905b7"; + overrides = { + # /nix/store/vjdwykj1l3hkr5hzjdr4m1m2mq8vxj0i-replit-module-go-1.21 + # .runners["go-run"].displayVersion = "1.21.13"; + displayVersion = "1.21"; + }; + } { moduleId = "haskell-ghc9.0"; commit = "c48c43c6c698223ed3ce2abc5a2d708735a77d5b"; @@ -194,11 +203,16 @@ let moduleFromHistory = { moduleId, commit, deployment ? false, overrides }: let flake = getFlake "github:replit/nixmodules/${commit}"; + flakeMods = + if pkgs.lib.hasAttr "activeModules" flake then + flake.activeModules + else + flake.modules; module = if deployment then - (flake.deploymentModules or flake.modules).${moduleId} + (flake.deploymentModules or flakeMods).${moduleId} else - flake.modules.${moduleId}; + flakeMods.${moduleId}; in pkgs.stdenvNoCC.mkDerivation { name = "replit-module-${moduleId}"; diff --git a/pkgs/modules/default.nix b/pkgs/modules/default.nix index cd53da1b..84f43493 100644 --- a/pkgs/modules/default.nix +++ b/pkgs/modules/default.nix @@ -64,9 +64,16 @@ let (import ./nodejs-with-prybar) (import ./go { - go = pkgs.go_1_21; + go = pkgs.go_1_22; gopls = pkgs.gopls.override { - buildGoModule = pkgs.buildGo121Module; + buildGoModule = pkgs.buildGo122Module; + }; + }) + + (import ./go { + go = pkgs.go_1_23; + gopls = pkgs.gopls.override { + buildGoModule = pkgs.buildGo123Module; }; }) diff --git a/pkgs/modules/docker/default.nix b/pkgs/modules/docker/default.nix index 3d8ed06e..d349e48f 100644 --- a/pkgs/modules/docker/default.nix +++ b/pkgs/modules/docker/default.nix @@ -4,7 +4,7 @@ let configFiles = pkgs.copyPathToStore ./etc; - replit-runc = pkgs.buildGo121Module { + replit-runc = pkgs.buildGo123Module { pname = "replit-runc"; version = "1.1.9+replit"; @@ -30,7 +30,7 @@ let ''; }; - replit-containerd = pkgs.buildGo121Module { + replit-containerd = pkgs.buildGo123Module { pname = "replit-containerd"; version = "1.7.5+replit"; @@ -65,7 +65,7 @@ let replitShimRunc = replit-containerd; }; - replit-buildkit = pkgs.buildGo121Module { + replit-buildkit = pkgs.buildGo123Module { pname = "replit-buildkit"; version = "v0.13.0-beta1+replit"; @@ -99,10 +99,9 @@ let replitShimRunc = replit-containerd; }; - mobyGoPackagePath = "github.com/docker/docker"; mobyVersion = "24.0.7+replit"; - replit-moby = pkgs.buildGoPackage { + replit-moby = pkgs.buildGoModule { pname = "replit-moby"; version = mobyVersion; @@ -113,7 +112,7 @@ let sha256 = "sha256-VUgsclXkoHHNT+GgYL7qiCV/4V3P9RZrT9BegMVYaRU="; }; - goPackagePath = mobyGoPackagePath; + vendorHash = null; nativeBuildInputs = [ pkgs.makeWrapper pkgs.pkg-config pkgs.go pkgs.libtool ]; @@ -133,7 +132,7 @@ let buildPhase = '' export GOCACHE="$TMPDIR/go-cache" # build engine - cd ./go/src/${mobyGoPackagePath} + cd ./go/src export AUTO_GOPATH=1 export DOCKER_GITCOMMIT="v${mobyVersion}" export VERSION="${mobyVersion}" @@ -142,7 +141,7 @@ let ''; postInstall = '' - cd ./go/src/${mobyGoPackagePath} + cd ./go/src install -Dm755 ./bundles/dynbinary-daemon/dockerd $out/libexec/docker/replit-dockerd makeWrapper $out/libexec/docker/replit-dockerd $out/bin/replit-dockerd \