summary refs log tree commit diff
path: root/nixos/modules/installer/cd-dvd/iso-image.nix
diff options
context:
space:
mode:
authorAtemu <atemu.main@gmail.com>2021-01-10 10:03:50 +0100
committerAtemu <atemu.main@gmail.com>2021-01-15 17:17:52 +0100
commit2fcab516c4cae0bc50455abd356f60e576fec5d9 (patch)
tree267db2aa5a208ec058539baf8b9599927499de6f /nixos/modules/installer/cd-dvd/iso-image.nix
parentf211631c1cb3e94828c7650b5d12c1e5a89e0e16 (diff)
downloadnixpkgs-2fcab516c4cae0bc50455abd356f60e576fec5d9.tar
nixpkgs-2fcab516c4cae0bc50455abd356f60e576fec5d9.tar.gz
nixpkgs-2fcab516c4cae0bc50455abd356f60e576fec5d9.tar.bz2
nixpkgs-2fcab516c4cae0bc50455abd356f60e576fec5d9.tar.lz
nixpkgs-2fcab516c4cae0bc50455abd356f60e576fec5d9.tar.xz
nixpkgs-2fcab516c4cae0bc50455abd356f60e576fec5d9.tar.zst
nixpkgs-2fcab516c4cae0bc50455abd356f60e576fec5d9.zip
iso-image: enable XZ compress filter
Minimal ISO:
1m21 -> 2m25
625M -> 617M

Plasma5 ISO:
2m45 -> 5m18
1.4G -> 1.3G

Decompression speed stays about the same. It's just a few seconds for the whole
image anyways and, with that kind of speed, you're going to be bottlenecked by
IO long before the CPU.
Diffstat (limited to 'nixos/modules/installer/cd-dvd/iso-image.nix')
-rw-r--r--nixos/modules/installer/cd-dvd/iso-image.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix
index 43d20a556f8..1418420afcd 100644
--- a/nixos/modules/installer/cd-dvd/iso-image.nix
+++ b/nixos/modules/installer/cd-dvd/iso-image.nix
@@ -425,7 +425,12 @@ in
     };
 
     isoImage.squashfsCompression = mkOption {
-      default = "xz -Xdict-size 100%";
+      default = with pkgs.stdenv.targetPlatform; "xz -Xdict-size 100% "
+                + lib.optionalString (isx86_32 || isx86_64) "-Xbcj x86"
+                # Untested but should also reduce size for these platforms
+                + lib.optionalString (isAarch32 || isAarch64) "-Xbcj arm"
+                + lib.optionalString (isPowerPC) "-Xbcj powerpc"
+                + lib.optionalString (isSparc) "-Xbcj sparc";
       description = ''
         Compression settings to use for the squashfs nix store.
       '';