Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

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.

(cherry picked from commit 487be791d783c706369a1a0740e03a0bb60d8f1f)

authored by Tuomas Tynkkynen and committed by Tuomas Tynkkynen c5575c46 17fb44e2

+7 -8
+7 -8
nixos/lib/make-ext4-fs.nix
··· 7 , volumeLabel 8 }: 9 10 pkgs.stdenv.mkDerivation { 11 name = "ext4-fs.img"; 12 13 nativeBuildInputs = with pkgs; [e2fsprogs libfaketime perl]; 14 - 15 - # For obtaining the closure of `storePaths'. 16 - exportReferencesGraph = 17 - map (x: [("closure-" + baseNameOf x) x]) storePaths; 18 19 buildCommand = 20 '' 21 # Add the closures of the top-level store objects. 22 - storePaths=$(perl ${pkgs.pathsFromGraph} closure-*) 23 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 27 28 # Make a crude approximation of the size of the target image. 29 # If the script starts failing, increase the fudge factors here.
··· 7 , volumeLabel 8 }: 9 10 + let 11 + sdClosureInfo = pkgs.closureInfo { rootPaths = storePaths; }; 12 + in 13 + 14 pkgs.stdenv.mkDerivation { 15 name = "ext4-fs.img"; 16 17 nativeBuildInputs = with pkgs; [e2fsprogs libfaketime perl]; 18 19 buildCommand = 20 '' 21 # Add the closures of the top-level store objects. 22 + storePaths=$(cat ${sdClosureInfo}/store-paths) 23 24 + # Also include a manifest of the closures in a format suitable for nix-store --load-db. 25 + cp ${sdClosureInfo}/registration nix-path-registration 26 27 # Make a crude approximation of the size of the target image. 28 # If the script starts failing, increase the fudge factors here.