Skip to content

Commit

Permalink
Make the .deb file fully-reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
the-sun-will-rise-tomorrow committed Jul 3, 2024
1 parent 17dd440 commit 4d85d1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ let
# These are not necessarily the same as the ones used in the output
# for cases such as cross compilation
buildPackages = {
inherit (pkgs.buildPackages) nix;
inherit (pkgs.buildPackages) nix sqlite;
};

profile =
Expand Down Expand Up @@ -121,12 +121,15 @@ let
ln -s ${profile} nix/var/nix/profiles/system
chmod -R 755 nix/var/nix/profiles/per-user
# Reset registration times to make the output reproducible
${buildPackages.sqlite}/bin/sqlite3 nix/var/nix/db/db.sqlite "UPDATE ValidPaths SET registrationTime = ''${SOURCE_DATE_EPOCH}"
for path in $(cat ${closure}/store-paths); do
cp -va $path nix/store/
done
# Create a tarball with the Nix store for bootstraping
XZ_OPT="-T$NIX_BUILD_CORES" tar --owner=0 --group=0 --lzma -c -p -f $out nix
XZ_OPT="-T1" tar --owner=0 --group=0 --sort=name --mtime="@''${SOURCE_DATE_EPOCH}" --lzma -c -p -f $out nix
''
);

Expand Down

0 comments on commit 4d85d1c

Please sign in to comment.