diff options
author | Joachim Fasting <joachifm@fastmail.fm> | 2016-12-20 15:15:06 +0100 |
---|---|---|
committer | Joachim Fasting <joachifm@fastmail.fm> | 2016-12-20 15:26:21 +0100 |
commit | 168fe999e71efa89326ce1df75e0df249e454ab2 (patch) | |
tree | 8e3c80544ea6f4e0deccecfc4b2bef507dff0d66 /nixos/lib/make-system-tarball.sh | |
parent | b9d3898995f2a86f0b11c84d3b68bb12bb08d090 (diff) |
make-system-tarball: create reproducible tarballs
Ensure that archive members are added in sorted order with a fixed mtime. This allows `nix-build --check` to succeed (when building a tarball of a simple system configuration). We also remove env-vars which doesn't appear to do much apart from capture a bunch of store paths we probably don't want. This is an alternative to https://github.com/NixOS/nixpkgs/pull/2281/commits/4b78a5b5fb8584347999832b3c67d1276488140b
Diffstat (limited to 'nixos/lib/make-system-tarball.sh')
-rw-r--r-- | nixos/lib/make-system-tarball.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/lib/make-system-tarball.sh b/nixos/lib/make-system-tarball.sh index e04455e889b01..efb83d914287a 100644 --- a/nixos/lib/make-system-tarball.sh +++ b/nixos/lib/make-system-tarball.sh @@ -52,9 +52,10 @@ $extraCommands mkdir -p $out/tarball -tar cvJf $out/tarball/$fileName.tar.xz * $extraArgs +rm env-vars + +tar --sort=name --mtime='1970-01-01' -cvJf $out/tarball/$fileName.tar.xz * $extraArgs mkdir -p $out/nix-support echo $system > $out/nix-support/system echo "file system-tarball $out/tarball/$fileName.tar.xz" > $out/nix-support/hydra-build-products - |