summary refs log tree commit diff
path: root/nixos/lib/make-system-tarball.nix
diff options
context:
space:
mode:
authorDing Xiang Fei <dingxiangfei2009@gmail.com>2018-10-30 15:44:00 +0800
committerDing Xiang Fei <dingxiangfei2009@gmail.com>2018-11-07 12:52:53 +0800
commit4259f7575e5a715bf4001e22894ce95cdc06385a (patch)
treed02a5a8c3a2762c5d8c52e1b0a6e4dacc040dd63 /nixos/lib/make-system-tarball.nix
parentb8040919b01b5d70b029fe4824a65a7928a6d100 (diff)
downloadnixpkgs-4259f7575e5a715bf4001e22894ce95cdc06385a.tar
nixpkgs-4259f7575e5a715bf4001e22894ce95cdc06385a.tar.gz
nixpkgs-4259f7575e5a715bf4001e22894ce95cdc06385a.tar.bz2
nixpkgs-4259f7575e5a715bf4001e22894ce95cdc06385a.tar.lz
nixpkgs-4259f7575e5a715bf4001e22894ce95cdc06385a.tar.xz
nixpkgs-4259f7575e5a715bf4001e22894ce95cdc06385a.tar.zst
nixpkgs-4259f7575e5a715bf4001e22894ce95cdc06385a.zip
use closure-info for building system tarball
Diffstat (limited to 'nixos/lib/make-system-tarball.nix')
-rw-r--r--nixos/lib/make-system-tarball.nix20
1 files changed, 12 insertions, 8 deletions
diff --git a/nixos/lib/make-system-tarball.nix b/nixos/lib/make-system-tarball.nix
index 846013b02d1..dee91a6ce3f 100644
--- a/nixos/lib/make-system-tarball.nix
+++ b/nixos/lib/make-system-tarball.nix
@@ -1,4 +1,4 @@
-{ stdenv, perl, pixz, pathsFromGraph
+{ stdenv, closureInfo, pixz
 
 , # The file name of the resulting tarball
   fileName ? "nixos-system-${stdenv.hostPlatform.system}"
@@ -29,24 +29,28 @@
 , extraInputs ? [ pixz ]
 }:
 
+let
+  symlinks = map (x: x.symlink) storeContents;
+  objects = map (x: x.object) storeContents;
+in
+
 stdenv.mkDerivation {
   name = "tarball";
   builder = ./make-system-tarball.sh;
-  buildInputs = [ perl ] ++ extraInputs;
+  buildInputs = extraInputs;
 
-  inherit fileName pathsFromGraph extraArgs extraCommands compressCommand;
+  inherit fileName extraArgs extraCommands compressCommand;
 
   # !!! should use XML.
   sources = map (x: x.source) contents;
   targets = map (x: x.target) contents;
 
   # !!! should use XML.
-  objects = map (x: x.object) storeContents;
-  symlinks = map (x: x.symlink) storeContents;
+  inherit symlinks objects;
 
-  # For obtaining the closure of `storeContents'.
-  exportReferencesGraph =
-    map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
+  closureInfo = closureInfo {
+    rootPaths = objects;
+  };
 
   extension = compressionExtension;
 }