summaryrefslogtreecommitdiffstats
path: root/nixos/modules/system/boot/loader/grub/grub.nix
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2023-03-19 21:44:31 +0100
committerFelix Buehler <account@buehler.rocks>2023-04-07 13:38:33 +0200
commit327b0cff7aedc20a148d245b1182f43800acc1f5 (patch)
treea498ae1b2dd2289310483d81345903d7e9123cb7 /nixos/modules/system/boot/loader/grub/grub.nix
parentb392d9b827cf4bb52141ab86e4202ec340f0b181 (diff)
treewide: use more lib.optionalString
Diffstat (limited to 'nixos/modules/system/boot/loader/grub/grub.nix')
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index 121d7e88e74d..5c0a07fb5127 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -33,7 +33,7 @@ let
then realGrub.override { efiSupport = cfg.efiSupport; }
else null;
- f = x: if x == null then "" else "" + x;
+ f = x: optionalString (x != null) ("" + x);
grubConfig = args:
let
@@ -52,7 +52,7 @@ let
fullName = lib.getName realGrub;
fullVersion = lib.getVersion realGrub;
grubEfi = f grubEfi;
- grubTargetEfi = if cfg.efiSupport && (cfg.version == 2) then f (grubEfi.grubTarget or "") else "";
+ grubTargetEfi = optionalString (cfg.efiSupport && (cfg.version == 2)) (f (grubEfi.grubTarget or ""));
bootPath = args.path;
storePath = config.boot.loader.grub.storePath;
bootloaderId = if args.efiBootloaderId == null then "${config.system.nixos.distroName}${efiSysMountPoint'}" else args.efiBootloaderId;