Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix flake update #403

Merged
merged 5 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions pkgs/historical-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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}";
Expand Down
11 changes: 9 additions & 2 deletions pkgs/modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
})

Expand Down
15 changes: 7 additions & 8 deletions pkgs/modules/docker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -30,7 +30,7 @@ let
'';
};

replit-containerd = pkgs.buildGo121Module {
replit-containerd = pkgs.buildGo123Module {
pname = "replit-containerd";
version = "1.7.5+replit";

Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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;

Expand All @@ -113,7 +112,7 @@ let
sha256 = "sha256-VUgsclXkoHHNT+GgYL7qiCV/4V3P9RZrT9BegMVYaRU=";
};

goPackagePath = mobyGoPackagePath;
vendorHash = null;

nativeBuildInputs = [ pkgs.makeWrapper pkgs.pkg-config pkgs.go pkgs.libtool ];

Expand All @@ -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}"
Expand All @@ -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 \
Expand Down
Loading