summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorRobert Schütz <robert.schuetz@stud.uni-heidelberg.de>2018-04-10 09:13:36 +0200
committerRobert Schütz <robert.schuetz@stud.uni-heidelberg.de>2018-04-10 09:13:36 +0200
commit80fc5f2a24fc626218be6b9c24d3bf6ef86444fe (patch)
tree2fa67fa3181544f6bea4ee8a7f071461c55b4d92 /nixos/lib
parent0aa59a08d65461149552f68c638655ed2b474510 (diff)
parentc4f555a505f7cb2e7453459a5c734682532645e4 (diff)
downloadnixlib-80fc5f2a24fc626218be6b9c24d3bf6ef86444fe.tar
nixlib-80fc5f2a24fc626218be6b9c24d3bf6ef86444fe.tar.gz
nixlib-80fc5f2a24fc626218be6b9c24d3bf6ef86444fe.tar.bz2
nixlib-80fc5f2a24fc626218be6b9c24d3bf6ef86444fe.tar.lz
nixlib-80fc5f2a24fc626218be6b9c24d3bf6ef86444fe.tar.xz
nixlib-80fc5f2a24fc626218be6b9c24d3bf6ef86444fe.tar.zst
nixlib-80fc5f2a24fc626218be6b9c24d3bf6ef86444fe.zip
Merge branch 'master' into staging
Diffstat (limited to 'nixos/lib')
-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.