summary refs log tree commit diff
path: root/nixos/modules/tasks/filesystems.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/tasks/filesystems.nix')
-rw-r--r--nixos/modules/tasks/filesystems.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index 4b189a801b2a..d00f479754ff 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -146,7 +146,9 @@ in
 
         # Filesystems.
         ${flip concatMapStrings fileSystems (fs:
-            (if fs.device != null then fs.device else "/dev/disk/by-label/${fs.label}")
+            (if fs.device != null then fs.device
+             else if fs.label != null then "/dev/disk/by-label/${fs.label}"
+             else throw "No device specified for mount point ‘${fs.mountPoint}’.")
             + " " + fs.mountPoint
             + " " + fs.fsType
             + " " + fs.options