From 94ce6ec866a51ff8e520a1acc592f4de04b5759c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 30 Jul 2014 13:10:03 +0200 Subject: [PATCH] Print a sensible error message if no device is specified for a filesystem --- nixos/modules/tasks/filesystems.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 4b189a801b2..d00f479754f 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