From dff372db3c423dd0efba2723187d85572b089d62 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Oct 2010 22:21:51 +0000 Subject: [PATCH] * Fix evaluation of the luksroot module when luksRoot == null. The problem is that configuration values below a mkIf are evaluated strictly even if the condition is false. Thus "${luksRoot}" causes an evaluation error. As a workaround, use the empty string instead of `null' as the default value. However, we should really fix the laziness of mkIf. It's likely that NixOS evaluation would be much faster if it didn't have to evaluate disabled configuration values. svn path=/nixos/trunk/; revision=24477 --- modules/module-list.nix | 2 +- modules/system/boot/luksroot.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/module-list.nix b/modules/module-list.nix index 1753bdc84186..1364b28182d1 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -146,7 +146,7 @@ ./system/activation/activation-script.nix ./system/activation/top-level.nix ./system/boot/kernel.nix - #./system/boot/luksroot.nix + ./system/boot/luksroot.nix ./system/boot/modprobe.nix ./system/boot/stage-1.nix ./system/boot/stage-2.nix diff --git a/modules/system/boot/luksroot.nix b/modules/system/boot/luksroot.nix index f345db459f0f..a01395647a37 100644 --- a/modules/system/boot/luksroot.nix +++ b/modules/system/boot/luksroot.nix @@ -10,7 +10,7 @@ in options = { boot.initrd.luksRoot = mkOption { - default = null; + default = ""; example = "/dev/sda3"; description = ''; The device that should be decrypted using LUKS before trying to mount the @@ -26,7 +26,7 @@ in - config = mkIf (luksRoot != null) { + config = mkIf (luksRoot != "") { boot.initrd.extraUtilsCommands = '' cp -r ${pkgs.cryptsetup}/lib/* $out/lib/