From 30690d05bc5676a93b4491c19f98217583b58dbd Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sun, 21 Sep 2014 20:41:46 +0200 Subject: [PATCH] Add cryptodisk support for Grub Closes #4193 --- nixos/modules/system/boot/loader/grub/grub.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index c46b3ba705ad..3ea00e40c3b3 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -234,6 +234,15 @@ in ''; }; + enableCryptodisk = mkOption { + default = false; + type = types.bool; + description = '' + Enable support for encrypted partitions. Grub should automatically + unlock the correct encrypted partition and look for filesystems. + ''; + }; + }; }; @@ -261,6 +270,7 @@ in throw "You must set the option ‘boot.loader.grub.device’ to make the system bootable." else "PERL5LIB=${makePerlPath (with pkgs.perlPackages; [ FileSlurp XMLLibXML XMLSAX ])} " + + (if cfg.enableCryptodisk then "GRUB_ENABLE_CRYPTODISK=y " else "") + "${pkgs.perl}/bin/perl ${./install-grub.pl} ${grubConfig}"; system.build.grub = grub;