diff options
| author | Nick Cao <nickcao@nichi.co> | 2024-02-25 11:22:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-25 11:22:20 -0500 |
| commit | 65de1f4ff2fafbde64b1c39fcd976098a6d08f79 (patch) | |
| tree | b0c13b17c44f3cc2971a643682cc47d33c2cff5e | |
| parent | Merge pull request #290814 from NixOS/backport-278896-to-release-23.11 (diff) | |
| parent | nixos/lib/make-squashfs.nix: allow disabling compression (diff) | |
| download | nixpkgs-65de1f4ff2fafbde64b1c39fcd976098a6d08f79.tar.gz | |
Merge pull request #287514 from NixOS/backport-256709-to-release-23.11
[Backport release-23.11] nixos/lib/make-squashfs.nix: allow disabling compression
| -rw-r--r-- | nixos/lib/make-squashfs.nix | 3 | ||||
| -rw-r--r-- | nixos/modules/installer/cd-dvd/iso-image.nix | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/nixos/lib/make-squashfs.nix b/nixos/lib/make-squashfs.nix index 4b6b56739948..f28e2c671580 100644 --- a/nixos/lib/make-squashfs.nix +++ b/nixos/lib/make-squashfs.nix @@ -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"; @@ -39,7 +40,7 @@ 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 ''; } diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index 0b5135c088ea..6adb94e09aff 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -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"; }; |
