mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
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.
This commit is contained in:
parent
a4ac9eb22e
commit
d77150df30
2 changed files with 5 additions and 2 deletions
|
@ -15,6 +15,9 @@
|
||||||
# store path whose closure will be copied, and `symlink' is a
|
# store path whose closure will be copied, and `symlink' is a
|
||||||
# symlink to `object' that will be added to the tarball.
|
# symlink to `object' that will be added to the tarball.
|
||||||
storeContents ? []
|
storeContents ? []
|
||||||
|
|
||||||
|
# Extra tar arguments
|
||||||
|
, extraArgs ? ""
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
|
@ -22,7 +25,7 @@ stdenv.mkDerivation {
|
||||||
builder = ./make-system-tarball.sh;
|
builder = ./make-system-tarball.sh;
|
||||||
buildInputs = [perl xz];
|
buildInputs = [perl xz];
|
||||||
|
|
||||||
inherit fileName pathsFromGraph;
|
inherit fileName pathsFromGraph extraArgs;
|
||||||
|
|
||||||
# !!! should use XML.
|
# !!! should use XML.
|
||||||
sources = map (x: x.source) contents;
|
sources = map (x: x.source) contents;
|
||||||
|
|
|
@ -50,7 +50,7 @@ done
|
||||||
|
|
||||||
mkdir -p $out/tarball
|
mkdir -p $out/tarball
|
||||||
|
|
||||||
tar cvJf $out/tarball/$fileName.tar.xz *
|
tar cvJf $out/tarball/$fileName.tar.xz * $extraArgs
|
||||||
|
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
echo $system > $out/nix-support/system
|
echo $system > $out/nix-support/system
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue