@@ -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.