diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-17 13:30:49 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-17 13:30:49 +0200 |
commit | b33657df03e411441625019f1cfe1e1b08135497 (patch) | |
tree | 4db593d244a3bc818739bcc7ee2c43360ce8eef0 /nixos | |
parent | 34d61c53c2c95f9c2a3bf05b3d08504ebbde642c (diff) | |
download | nixlib-b33657df03e411441625019f1cfe1e1b08135497.tar nixlib-b33657df03e411441625019f1cfe1e1b08135497.tar.gz nixlib-b33657df03e411441625019f1cfe1e1b08135497.tar.bz2 nixlib-b33657df03e411441625019f1cfe1e1b08135497.tar.lz nixlib-b33657df03e411441625019f1cfe1e1b08135497.tar.xz nixlib-b33657df03e411441625019f1cfe1e1b08135497.tar.zst nixlib-b33657df03e411441625019f1cfe1e1b08135497.zip |
grub: Make assertion lazier
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/boot/loader/grub/grub.nix | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 8e9f3253f877..c7c1f675c778 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -237,13 +237,14 @@ in boot.loader.grub.devices = optional (cfg.device != "") cfg.device; - system.build = mkAssert (cfg.devices != []) - "You must set the ‘boot.loader.grub.device’ option to make the system bootable." - { installBootLoader = - "PERL5LIB=${makePerlPath [ pkgs.perlPackages.XMLLibXML pkgs.perlPackages.XMLSAX ]} " + - "${pkgs.perl}/bin/perl ${./install-grub.pl} ${grubConfig}"; - inherit grub; - }; + system.build.installBootLoader = + if cfg.devices == [] then + throw "You must set the ‘boot.loader.grub.device’ option to make the system bootable." + else + "PERL5LIB=${makePerlPath [ pkgs.perlPackages.XMLLibXML pkgs.perlPackages.XMLSAX ]} " + + "${pkgs.perl}/bin/perl ${./install-grub.pl} ${grubConfig}"; + + system.build.grub = grub; # Common attribute for boot loaders so only one of them can be # set at once. |