diff --git a/nixos/modules/tasks/encrypted-devices.nix b/nixos/modules/tasks/encrypted-devices.nix index b019ddc3a98c..fa0abb43c0ce 100644 --- a/nixos/modules/tasks/encrypted-devices.nix +++ b/nixos/modules/tasks/encrypted-devices.nix @@ -56,6 +56,13 @@ in }; config = mkIf anyEncrypted { + assertions = map (dev: { + assertion = dev.label != null; + message = '' + The filesystem for ${dev.mountPoint} has encrypted.enable set to true, but no encrypted.label set + ''; + }) encDevs; + boot.initrd = { luks = { devices =