diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-11-18 16:26:39 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-11-18 18:04:16 +0100 |
commit | dc87f8e0809d2c4453b8f6460e33a879af098574 (patch) | |
tree | 06092869c99fbb26aa78cfe52e81166bf6828473 /nixos/modules | |
parent | 8951be2d805cfb03b98900530a0bdb64146111a0 (diff) |
Check whether fileSystems defines the root FS
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/system/boot/stage-1.nix | 5 | ||||
-rw-r--r-- | nixos/modules/tasks/filesystems.nix | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index b2b662803728..7f7184b1e453 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -330,6 +330,11 @@ in config = { + assertions = singleton + { assertion = any (fs: fs.mountPoint == "/") (attrValues config.fileSystems); + message = "The ‘fileSystems’ option does not specify your root file system."; + }; + system.build.bootStage1 = bootStage1; system.build.initialRamdisk = initialRamdisk; system.build.extraUtils = extraUtils; diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 3f484045ed4c..b0bcd2eb373e 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -81,6 +81,7 @@ in options = { fileSystems = mkOption { + default = {}; example = { "/".device = "/dev/hda1"; "/data" = { |