summary refs log tree commit diff
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2014-08-25 02:45:33 +0200
committerJaka Hudoklin <jakahudoklin@gmail.com>2014-08-25 03:29:07 +0200
commitd77150df30c46b5cdf70aae79893bfb2fbc621a8 (patch)
tree774a8d1a390135e075d4b4cff59749d9625e0c89
parenta4ac9eb22e5559e7def4f58ea96837023aeae8bd (diff)
downloadnixpkgs-d77150df30c46b5cdf70aae79893bfb2fbc621a8.tar
nixpkgs-d77150df30c46b5cdf70aae79893bfb2fbc621a8.tar.gz
nixpkgs-d77150df30c46b5cdf70aae79893bfb2fbc621a8.tar.bz2
nixpkgs-d77150df30c46b5cdf70aae79893bfb2fbc621a8.tar.lz
nixpkgs-d77150df30c46b5cdf70aae79893bfb2fbc621a8.tar.xz
nixpkgs-d77150df30c46b5cdf70aae79893bfb2fbc621a8.tar.zst
nixpkgs-d77150df30c46b5cdf70aae79893bfb2fbc621a8.zip
nixos: make-system-tarball, add option for extra arguments for tar
Sometimes extra arguments when making tarball are required,
for example if making a container owner of files has to be changed
to root.
-rw-r--r--nixos/lib/make-system-tarball.nix5
-rw-r--r--nixos/lib/make-system-tarball.sh2
2 files changed, 5 insertions, 2 deletions
diff --git a/nixos/lib/make-system-tarball.nix b/nixos/lib/make-system-tarball.nix
index 8fed9a34882..3bd891fdbc2 100644
--- a/nixos/lib/make-system-tarball.nix
+++ b/nixos/lib/make-system-tarball.nix
@@ -15,6 +15,9 @@
   # store path whose closure will be copied, and `symlink' is a
   # symlink to `object' that will be added to the tarball.
   storeContents ? []
+
+  # Extra tar arguments
+, extraArgs ? ""
 }:
 
 stdenv.mkDerivation {
@@ -22,7 +25,7 @@ stdenv.mkDerivation {
   builder = ./make-system-tarball.sh;
   buildInputs = [perl xz];
 
-  inherit fileName pathsFromGraph;
+  inherit fileName pathsFromGraph extraArgs;
 
   # !!! should use XML.
   sources = map (x: x.source) contents;
diff --git a/nixos/lib/make-system-tarball.sh b/nixos/lib/make-system-tarball.sh
index 096d96ac1c8..2eb668115a6 100644
--- a/nixos/lib/make-system-tarball.sh
+++ b/nixos/lib/make-system-tarball.sh
@@ -50,7 +50,7 @@ done
 
 mkdir -p $out/tarball
 
-tar cvJf $out/tarball/$fileName.tar.xz *
+tar cvJf $out/tarball/$fileName.tar.xz * $extraArgs
 
 mkdir -p $out/nix-support
 echo $system > $out/nix-support/system