summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorArnout Engelen <arnout@bzzt.net>2021-02-28 19:03:50 +0100
committerGitHub <noreply@github.com>2021-02-28 18:03:50 +0000
commit0aeba64fb26e4defa0842a942757144659c6e29f (patch)
treee916f657df91f4101d6145d3bd9ce84a9b915ac2 /nixos/lib
parentc6898f85418fd2a895a17fb9a9ba64d2ca1e9803 (diff)
downloadnixpkgs-0aeba64fb26e4defa0842a942757144659c6e29f.tar
nixpkgs-0aeba64fb26e4defa0842a942757144659c6e29f.tar.gz
nixpkgs-0aeba64fb26e4defa0842a942757144659c6e29f.tar.bz2
nixpkgs-0aeba64fb26e4defa0842a942757144659c6e29f.tar.lz
nixpkgs-0aeba64fb26e4defa0842a942757144659c6e29f.tar.xz
nixpkgs-0aeba64fb26e4defa0842a942757144659c6e29f.tar.zst
nixpkgs-0aeba64fb26e4defa0842a942757144659c6e29f.zip
squashfs: use -no-hardlinks for reproducible squashfs images (#114454)
the nix store may contain hardlinks: derivations may output them
directly, or users may be using store optimization which automatically
hardlinks identical files in the nix store.

The presence of these links are intended to be a 'transparent'
optimization. However, when creating a squashfs image, the image
will be different depending on whether hard links were present
on the filesystem, leading to reproducibility problems.

By passing '-no-hardlinks' to mksquashfs the files are stored
as duplicates in the squashfs image. Since squashfs has support
for duplicate files this does not lead to a larger image.

For more details see
https://github.com/NixOS/nixpkgs/issues/114331
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/make-squashfs.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/lib/make-squashfs.nix b/nixos/lib/make-squashfs.nix
index ee76c9c5bf2..8690c42e7ac 100644
--- a/nixos/lib/make-squashfs.nix
+++ b/nixos/lib/make-squashfs.nix
@@ -23,6 +23,6 @@ stdenv.mkDerivation {
 
       # Generate the squashfs image.
       mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $out \
-        -keep-as-directory -all-root -b 1048576 -comp ${comp}
+        -no-hardlinks -keep-as-directory -all-root -b 1048576 -comp ${comp}
     '';
 }