nixos/make-system-tarball: extra commands to be executed before archive

This commit is contained in:
Jaka Hudoklin 2014-12-11 22:54:46 +01:00
parent 747488ae66
commit a782b890d5
2 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,9 @@
# symlink to `object' that will be added to the tarball. # symlink to `object' that will be added to the tarball.
storeContents ? [] storeContents ? []
# Extra commands to be executed before archiving files
, extraCommands ? ""
# Extra tar arguments # Extra tar arguments
, extraArgs ? "" , extraArgs ? ""
}: }:
@ -25,7 +28,7 @@ stdenv.mkDerivation {
builder = ./make-system-tarball.sh; builder = ./make-system-tarball.sh;
buildInputs = [perl xz]; buildInputs = [perl xz];
inherit fileName pathsFromGraph extraArgs; inherit fileName pathsFromGraph extraArgs extraCommands;
# !!! should use XML. # !!! should use XML.
sources = map (x: x.source) contents; sources = map (x: x.source) contents;

View File

@ -33,7 +33,7 @@ for i in $storePaths; do
done done
# TODO tar ruxo # TODO tar ruxo
# Also include a manifest of the closures in a format suitable for # Also include a manifest of the closures in a format suitable for
# nix-store --load-db. # nix-store --load-db.
printRegistration=1 perl $pathsFromGraph closure-* > nix-path-registration printRegistration=1 perl $pathsFromGraph closure-* > nix-path-registration
@ -48,6 +48,8 @@ for ((n = 0; n < ${#objects[*]}; n++)); do
fi fi
done done
$extraCommands
mkdir -p $out/tarball mkdir -p $out/tarball
tar cvJf $out/tarball/$fileName.tar.xz * $extraArgs tar cvJf $out/tarball/$fileName.tar.xz * $extraArgs