1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

docker: shrink code - use buildenv.manifest

This commit is contained in:
h0nIg 2025-06-06 23:54:15 +02:00 committed by GitHub
parent e72a0ad8c3
commit 2caccbed11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,12 +165,7 @@ let
echo "[]" > $out/manifest.nix echo "[]" > $out/manifest.nix
fi fi
''; '';
rootEnv = pkgs.buildPackages.buildEnv {
name = "root-profile-env";
paths = defaultPkgs;
};
# doc/manual/source/command-ref/files/manifest.nix.md # doc/manual/source/command-ref/files/manifest.nix.md
# may get replaced by pkgs.buildEnv once manifest.json can get written
manifest = pkgs.buildPackages.runCommand "manifest.nix" { } '' manifest = pkgs.buildPackages.runCommand "manifest.nix" { } ''
cat > $out <<EOF cat > $out <<EOF
[ [
@ -200,11 +195,15 @@ let
] ]
EOF EOF
''; '';
profile = pkgs.buildPackages.runCommand "user-environment" { } '' profile = pkgs.buildPackages.buildEnv {
mkdir $out name = "root-profile-env";
cp -a ${rootEnv}/* $out/ paths = defaultPkgs;
ln -s ${manifest} $out/manifest.nix
postBuild = ''
mv $out/manifest $out/manifest.nix
''; '';
inherit manifest;
};
flake-registry-path = flake-registry-path =
if (flake-registry == null) then if (flake-registry == null) then
null null