From bb76f3914548a5501353515e91f738987ea058c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 19 May 2024 13:49:36 +0200 Subject: [PATCH] iso: default to zstd compression For most users of nixos-generate zstd will be the better choice as it will build and boot images much faster. Often users have to rebuild images a couple of times before they are happy with the result. NixOS might be better of with xz as it saves download and storage cost for images. --- formats/install-iso.nix | 3 +++ formats/iso.nix | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/formats/install-iso.nix b/formats/install-iso.nix index f047167..e7fbd05 100644 --- a/formats/install-iso.nix +++ b/formats/install-iso.nix @@ -12,6 +12,9 @@ systemd.services.wpa_supplicant.wantedBy = lib.mkForce ["multi-user.target"]; systemd.services.sshd.wantedBy = lib.mkForce ["multi-user.target"]; + # Much faster than xz + isoImage.squashfsCompression = lib.mkDefault "zstd"; + formatAttr = "isoImage"; fileExtension = ".iso"; } diff --git a/formats/iso.nix b/formats/iso.nix index 4531e7a..1b1a232 100644 --- a/formats/iso.nix +++ b/formats/iso.nix @@ -1,5 +1,5 @@ { - config, + lib, modulesPath, ... }: { @@ -13,6 +13,9 @@ # USB booting isoImage.makeUsbBootable = true; + # Much faster than xz + isoImage.squashfsCompression = lib.mkDefault "zstd"; + formatAttr = "isoImage"; fileExtension = ".iso"; }