From f7672530de22a62b86401e59ac55e246dce78539 Mon Sep 17 00:00:00 2001 From: K900 Date: Tue, 23 Apr 2024 09:13:59 +0300 Subject: [PATCH] pkgs/top-level/make-tarball.nix: make reproducible --- pkgs/top-level/make-tarball.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/make-tarball.nix b/pkgs/top-level/make-tarball.nix index 0e17ebef074a..78b90082547b 100644 --- a/pkgs/top-level/make-tarball.nix +++ b/pkgs/top-level/make-tarball.nix @@ -58,12 +58,19 @@ pkgs.releaseTools.sourceTarball { distPhase = '' mkdir -p $out/tarballs XZ_OPT="-T0" tar \ - --absolute-names \ - --transform="s|^$src|$releaseName|g" \ - --transform="s|^$(pwd)|$releaseName|g" \ --create \ --xz \ --file=$out/tarballs/$releaseName.tar.xz \ + --absolute-names \ + --transform="s|^$src|$releaseName|g" \ + --transform="s|^$(pwd)|$releaseName|g" \ + --owner=0 \ + --group=0 \ + --numeric-owner \ + --format=gnu \ + --sort=name \ + --mtime="@$SOURCE_DATE_EPOCH" \ + --mode=ug+w \ $src $(pwd)/{.version-suffix,.git-revision} ''; }