treewide: use more lib.optionalString

This commit is contained in:
Felix Buehler
2023-03-19 21:44:31 +01:00
parent b392d9b827
commit 327b0cff7a
41 changed files with 89 additions and 95 deletions

View File

@@ -20,7 +20,7 @@ let
nix = config.nix.package.out;
timeout = if config.boot.loader.timeout != null then config.boot.loader.timeout else "";
timeout = optionalString (config.boot.loader.timeout != null) config.boot.loader.timeout;
editor = if cfg.editor then "True" else "False";
@@ -32,9 +32,9 @@ let
inherit (config.system.nixos) distroName;
memtest86 = if cfg.memtest86.enable then pkgs.memtest86-efi else "";
memtest86 = optionalString cfg.memtest86.enable pkgs.memtest86-efi;
netbootxyz = if cfg.netbootxyz.enable then pkgs.netbootxyz-efi else "";
netbootxyz = optionalString cfg.netbootxyz.enable pkgs.netbootxyz-efi;
copyExtraFiles = pkgs.writeShellScript "copy-extra-files" ''
empty_file=$(${pkgs.coreutils}/bin/mktemp)