nixos/grub: fix value precedence with optional -> mkIf (#338773)

This commit is contained in:
Jörg Thalheim
2024-09-03 08:29:25 +02:00
committed by GitHub
@@ -712,9 +712,9 @@ in
(mkIf cfg.enable {
boot.loader.grub.devices = optional (cfg.device != "") cfg.device;
boot.loader.grub.devices = mkIf (cfg.device != "") [ cfg.device ];
boot.loader.grub.mirroredBoots = optionals (cfg.devices != [ ]) [
boot.loader.grub.mirroredBoots = mkIf (cfg.devices != [ ]) [
{ path = "/boot"; inherit (cfg) devices; inherit (efi) efiSysMountPoint; }
];
@@ -752,7 +752,7 @@ in
# set at once.
system.boot.loader.id = "grub";
environment.systemPackages = optional (grub != null) grub;
environment.systemPackages = mkIf (grub != null) [ grub ];
boot.loader.grub.extraPrepareConfig =
concatStrings (mapAttrsToList (n: v: ''