diff --git a/nixos/lib/make-system-tarball.nix b/nixos/lib/make-system-tarball.nix index 3bd891fdbc2..a2a0340a6bd 100644 --- a/nixos/lib/make-system-tarball.nix +++ b/nixos/lib/make-system-tarball.nix @@ -16,6 +16,9 @@ # symlink to `object' that will be added to the tarball. storeContents ? [] + # Extra commands to be executed before archiving files +, extraCommands ? "" + # Extra tar arguments , extraArgs ? "" }: @@ -25,7 +28,7 @@ stdenv.mkDerivation { builder = ./make-system-tarball.sh; buildInputs = [perl xz]; - inherit fileName pathsFromGraph extraArgs; + inherit fileName pathsFromGraph extraArgs extraCommands; # !!! 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 2eb668115a6..e04455e889b 100644 --- a/nixos/lib/make-system-tarball.sh +++ b/nixos/lib/make-system-tarball.sh @@ -33,7 +33,7 @@ for i in $storePaths; do done -# TODO tar ruxo +# TODO tar ruxo # Also include a manifest of the closures in a format suitable for # nix-store --load-db. printRegistration=1 perl $pathsFromGraph closure-* > nix-path-registration @@ -48,6 +48,8 @@ for ((n = 0; n < ${#objects[*]}; n++)); do fi done +$extraCommands + mkdir -p $out/tarball tar cvJf $out/tarball/$fileName.tar.xz * $extraArgs