about summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorMatthias Berndt <matthias_berndt@gmx.de>2023-05-17 21:47:19 -0400
committerMatthias Berndt <matthias_berndt@gmx.de>2023-05-17 21:47:19 -0400
commitcb410a8c5919ae8fab94874d644cb6abe35487a6 (patch)
tree77bbd6082433f8e9e571614ab2baeef4fdfa6a36 /nixos/modules/installer
parent92814241a8b992c18accbb939360654369eb2cc4 (diff)
parent285aa1f48e62932fed2089ddb04768172ae4a625 (diff)
downloadnixlib-cb410a8c5919ae8fab94874d644cb6abe35487a6.tar
nixlib-cb410a8c5919ae8fab94874d644cb6abe35487a6.tar.gz
nixlib-cb410a8c5919ae8fab94874d644cb6abe35487a6.tar.bz2
nixlib-cb410a8c5919ae8fab94874d644cb6abe35487a6.tar.lz
nixlib-cb410a8c5919ae8fab94874d644cb6abe35487a6.tar.xz
nixlib-cb410a8c5919ae8fab94874d644cb6abe35487a6.tar.zst
nixlib-cb410a8c5919ae8fab94874d644cb6abe35487a6.zip
Merge remote-tracking branch 'upstream/master' into mberndt123/stratis-rootfs
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/cd-dvd/iso-image.nix5
-rw-r--r--nixos/modules/installer/netboot/netboot.nix15
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl1
3 files changed, 17 insertions, 4 deletions
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix
index ea17e2a705ed..e22bb866927b 100644
--- a/nixos/modules/installer/cd-dvd/iso-image.nix
+++ b/nixos/modules/installer/cd-dvd/iso-image.nix
@@ -473,7 +473,7 @@ in
     };
 
     isoImage.squashfsCompression = mkOption {
-      default = with pkgs.stdenv.targetPlatform; "xz -Xdict-size 100% "
+      default = with pkgs.stdenv.hostPlatform; "xz -Xdict-size 100% "
                 + lib.optionalString isx86 "-Xbcj x86"
                 # Untested but should also reduce size for these platforms
                 + lib.optionalString isAarch "-Xbcj arm"
@@ -483,6 +483,7 @@ in
         Compression settings to use for the squashfs nix store.
       '';
       example = "zstd -Xcompression-level 6";
+      type = types.str;
     };
 
     isoImage.edition = mkOption {
@@ -693,8 +694,6 @@ in
       }
     ];
 
-    boot.loader.grub.version = 2;
-
     # Don't build the GRUB menu builder script, since we don't need it
     # here and it causes a cyclic dependency.
     boot.loader.grub.enable = false;
diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix
index 03bb529cd851..a55c0ab2d655 100644
--- a/nixos/modules/installer/netboot/netboot.nix
+++ b/nixos/modules/installer/netboot/netboot.nix
@@ -8,6 +8,20 @@ with lib;
 {
   options = {
 
+    netboot.squashfsCompression = mkOption {
+      default = with pkgs.stdenv.hostPlatform; "xz -Xdict-size 100% "
+                + lib.optionalString isx86 "-Xbcj x86"
+                # Untested but should also reduce size for these platforms
+                + lib.optionalString isAarch "-Xbcj arm"
+                + lib.optionalString (isPower && is32bit && isBigEndian) "-Xbcj powerpc"
+                + lib.optionalString (isSparc) "-Xbcj sparc";
+      description = lib.mdDoc ''
+        Compression settings to use for the squashfs nix store.
+      '';
+      example = "zstd -Xcompression-level 6";
+      type = types.str;
+    };
+
     netboot.storeContents = mkOption {
       example = literalExpression "[ pkgs.stdenv ]";
       description = lib.mdDoc ''
@@ -77,6 +91,7 @@ with lib;
     # Create the squashfs image that contains the Nix store.
     system.build.squashfsStore = pkgs.callPackage ../../../lib/make-squashfs.nix {
       storeContents = config.netboot.storeContents;
+      comp = config.netboot.squashfsCompression;
     };
 
 
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index c822ea61200d..c2a5ecbe9e2e 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -668,7 +668,6 @@ EOF
             $bootLoaderConfig = <<EOF;
   # Use the GRUB 2 boot loader.
   boot.loader.grub.enable = true;
-  boot.loader.grub.version = 2;
   # boot.loader.grub.efiSupport = true;
   # boot.loader.grub.efiInstallAsRemovable = true;
   # boot.loader.efi.efiSysMountPoint = "/boot/efi";