about summary refs log tree commit diff
path: root/nixos/modules/tasks/encrypted-devices.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/tasks/encrypted-devices.nix')
-rw-r--r--nixos/modules/tasks/encrypted-devices.nix7
1 files changed, 7 insertions, 0 deletions
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 =