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) | |
download | nixpkgs-dc87f8e0809d2c4453b8f6460e33a879af098574.tar nixpkgs-dc87f8e0809d2c4453b8f6460e33a879af098574.tar.gz nixpkgs-dc87f8e0809d2c4453b8f6460e33a879af098574.tar.bz2 nixpkgs-dc87f8e0809d2c4453b8f6460e33a879af098574.tar.lz nixpkgs-dc87f8e0809d2c4453b8f6460e33a879af098574.tar.xz nixpkgs-dc87f8e0809d2c4453b8f6460e33a879af098574.tar.zst nixpkgs-dc87f8e0809d2c4453b8f6460e33a879af098574.zip |
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 b2b66280372..7f7184b1e45 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 3f484045ed4..b0bcd2eb373 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" = { |