grub.nix: Handle null values

http://hydra.nixos.org/build/2894714
This commit is contained in:
Eelco Dolstra 2012-07-25 09:27:51 -04:00
parent be4c4d79cf
commit 1b743526bd

View file

@ -8,9 +8,11 @@ let
grub = if cfg.version == 1 then pkgs.grub else pkgs.grub2;
f = x: if x == null then "" else "" + x;
grubConfig = pkgs.writeText "grub-config.xml" (builtins.toXML
{ splashImage = "" + config.boot.loader.grub.splashImage;
grub = "" + grub;
{ splashImage = f config.boot.loader.grub.splashImage;
grub = f grub;
inherit (config.boot.loader.grub)
version extraConfig extraPerEntryConfig extraEntries
extraEntriesBeforeNixOS configurationLimit copyKernels timeout