git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/make-ext4-fs: Use closureInfo

exportReferencesGraph is deprecated and doesn't have the generated initial Nix database contain the SHA256 of the contents of the store paths, which breaks various things under Nix 2.0.

commit487be791d783c706369a1a0740e03a0bb60d8f1f authorTuomas Tynkkynen <tuomas@tuxera.com> dateMon 9 Apr 2018, 22:24 (9 years ago) parent8322981
1 file changed+7−8
nixos/lib/make-ext4-fs.nix+7−8
nixos/lib/make-ext4-fs.nix+7−8
@@ -7,23 +7,22 @@
77, volumeLabel
88}:
99
10+let
11+ sdClosureInfo = pkgs.closureInfo { rootPaths = storePaths; };
12+in
13+
1014pkgs.stdenv.mkDerivation {
1115 name = "ext4-fs.img";
1216
1317 nativeBuildInputs = with pkgs; [e2fsprogs libfaketime perl];
1418
15− # For obtaining the closure of `storePaths'.
16− exportReferencesGraph =
17− map (x: [("closure-" + baseNameOf x) x]) storePaths;
18−
1919 buildCommand =
2020 ''
2121 # Add the closures of the top-level store objects.
22− storePaths=$(perl ${pkgs.pathsFromGraph} closure-*)
22+ storePaths=$(cat ${sdClosureInfo}/store-paths)
2323
24− # Also include a manifest of the closures in a format suitable
25− # for nix-store --load-db.
26− printRegistration=1 perl ${pkgs.pathsFromGraph} closure-* > nix-path-registration
24+ # Also include a manifest of the closures in a format suitable for nix-store --load-db.
25+ cp ${sdClosureInfo}/registration nix-path-registration
2726
2827 # Make a crude approximation of the size of the target image.
2928 # If the script starts failing, increase the fudge factors here.