1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-09 17:46:29 +09:00

nixos: make squashfs reproducible

This commit is contained in:
Jörg Thalheim 2025-03-31 10:49:10 +02:00 committed by Masum Reza
parent 8a41c43540
commit 4420d42422
2 changed files with 4 additions and 2 deletions

View file

@ -55,7 +55,8 @@ stdenv.mkDerivation {
+ ''
# Generate the squashfs image.
mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $imgPath ${pseudoFilesArgs} \
# We have to set SOURCE_DATE_EPOCH to 0 here for reproducibility (https://github.com/NixOS/nixpkgs/issues/390696)
SOURCE_DATE_EPOCH=0 mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $imgPath ${pseudoFilesArgs} \
-no-hardlinks ${lib.optionalString noStrip "-no-strip"} -keep-as-directory -all-root -b 1048576 ${compFlag} \
-processors $NIX_BUILD_CORES -root-mode 0755
''

View file

@ -107,7 +107,8 @@ stdenv.mkDerivation {
mkdir -p $out
# the '.raw' suffix is mandatory by the portable service spec
mksquashfs nix ${rootFsScaffold}/* $out/"${pname}_${version}.raw" \
# We have to set SOURCE_DATE_EPOCH to 0 here for reproducibility (https://github.com/NixOS/nixpkgs/issues/390696)
SOURCE_DATE_EPOCH=0 mksquashfs nix ${rootFsScaffold}/* $out/"${pname}_${version}.raw" \
-quiet -noappend \
-exit-on-error \
-keep-as-directory \