Skip to content

Commit

Permalink
nixos/lib/make-squashfs.nix: allow disabling compression
Browse files Browse the repository at this point in the history
  • Loading branch information
colemickens committed Nov 29, 2023
1 parent 64939c9 commit d6c3eca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nixos/lib/make-squashfs.nix
Expand Up @@ -14,6 +14,7 @@

let
pseudoFilesArgs = lib.concatMapStrings (f: ''-p "${f}" '') pseudoFiles;
compFlag = if comp == null then "-no-compression" else "-comp ${comp}";
in
stdenv.mkDerivation {
name = "${fileName}.img";
Expand All @@ -39,7 +40,8 @@ stdenv.mkDerivation {
# Generate the squashfs image.
mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $out ${pseudoFilesArgs} \
-no-hardlinks ${lib.optionalString noStrip "-no-strip"} -keep-as-directory -all-root -b 1048576 -comp ${comp} \
-no-hardlinks ${lib.optionalString noStrip "-no-strip"} -keep-as-directory -all-root -b 1048576 \
${compFlag} \
-processors $NIX_BUILD_CORES
'';
}
3 changes: 2 additions & 1 deletion nixos/modules/installer/cd-dvd/iso-image.nix
Expand Up @@ -512,9 +512,10 @@ in
+ lib.optionalString isAarch "-Xbcj arm"
+ lib.optionalString (isPower && is32bit && isBigEndian) "-Xbcj powerpc"
+ lib.optionalString (isSparc) "-Xbcj sparc";
type = lib.types.str;
type = lib.types.nullOr lib.types.str;
description = lib.mdDoc ''
Compression settings to use for the squashfs nix store.
`null` disables compression.
'';
example = "zstd -Xcompression-level 6";
};
Expand Down

0 comments on commit d6c3eca

Please sign in to comment.