summary refs log tree commit diff
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2018-04-09 22:24:01 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2018-04-10 00:31:36 +0300
commit487be791d783c706369a1a0740e03a0bb60d8f1f (patch)
treed52d7a1ff3fe83a97dafab30599b3e1e64525265
parent83229813b3a6aad729408a1f211d39b1b7acf614 (diff)
downloadnixlib-487be791d783c706369a1a0740e03a0bb60d8f1f.tar
nixlib-487be791d783c706369a1a0740e03a0bb60d8f1f.tar.gz
nixlib-487be791d783c706369a1a0740e03a0bb60d8f1f.tar.bz2
nixlib-487be791d783c706369a1a0740e03a0bb60d8f1f.tar.lz
nixlib-487be791d783c706369a1a0740e03a0bb60d8f1f.tar.xz
nixlib-487be791d783c706369a1a0740e03a0bb60d8f1f.tar.zst
nixlib-487be791d783c706369a1a0740e03a0bb60d8f1f.zip
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.
-rw-r--r--nixos/lib/make-ext4-fs.nix15
1 files changed, 7 insertions, 8 deletions
diff --git a/nixos/lib/make-ext4-fs.nix b/nixos/lib/make-ext4-fs.nix
index 21c69ed560a3..986d80ff1b99 100644
--- a/nixos/lib/make-ext4-fs.nix
+++ b/nixos/lib/make-ext4-fs.nix
@@ -7,23 +7,22 @@
 , volumeLabel
 }:
 
+let
+  sdClosureInfo = pkgs.closureInfo { rootPaths = storePaths; };
+in
+
 pkgs.stdenv.mkDerivation {
   name = "ext4-fs.img";
 
   nativeBuildInputs = with pkgs; [e2fsprogs libfaketime perl];
 
-  # For obtaining the closure of `storePaths'.
-  exportReferencesGraph =
-    map (x: [("closure-" + baseNameOf x) x]) storePaths;
-
   buildCommand =
     ''
       # Add the closures of the top-level store objects.
-      storePaths=$(perl ${pkgs.pathsFromGraph} closure-*)
+      storePaths=$(cat ${sdClosureInfo}/store-paths)
 
-      # Also include a manifest of the closures in a format suitable
-      # for nix-store --load-db.
-      printRegistration=1 perl ${pkgs.pathsFromGraph} closure-* > nix-path-registration
+      # Also include a manifest of the closures in a format suitable for nix-store --load-db.
+      cp ${sdClosureInfo}/registration nix-path-registration
 
       # Make a crude approximation of the size of the target image.
       # If the script starts failing, increase the fudge factors here.