summary refs log tree commit diff
path: root/nixos/lib/utils.nix
diff options
context:
space:
mode:
authorKeshav Kini <keshav.kini@gmail.com>2020-07-26 17:05:21 -0700
committerKeshav Kini <keshav.kini@gmail.com>2020-07-29 14:39:21 -0700
commit5e86bba0827a96388bff25ae85d4e163a12016f1 (patch)
tree5e9c1696834f95884527548d5844bb0a41d61341 /nixos/lib/utils.nix
parentea1287110f3fa124d31e59520f5c248029bd74da (diff)
downloadnixpkgs-5e86bba0827a96388bff25ae85d4e163a12016f1.tar
nixpkgs-5e86bba0827a96388bff25ae85d4e163a12016f1.tar.gz
nixpkgs-5e86bba0827a96388bff25ae85d4e163a12016f1.tar.bz2
nixpkgs-5e86bba0827a96388bff25ae85d4e163a12016f1.tar.lz
nixpkgs-5e86bba0827a96388bff25ae85d4e163a12016f1.tar.xz
nixpkgs-5e86bba0827a96388bff25ae85d4e163a12016f1.tar.zst
nixpkgs-5e86bba0827a96388bff25ae85d4e163a12016f1.zip
nixos/boot: some documentation improvements
- Give a more accurate description of how fileSystems.<name/>.neededForBoot
  works

- Give a more detailed description of how fileSystems.<name/>.encrypted.keyFile
  works
Diffstat (limited to 'nixos/lib/utils.nix')
-rw-r--r--nixos/lib/utils.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix
index 21f4c7c6988..543c8a8882e 100644
--- a/nixos/lib/utils.nix
+++ b/nixos/lib/utils.nix
@@ -2,9 +2,11 @@ pkgs: with pkgs.lib;
 
 rec {
 
-  # Check whenever fileSystem is needed for boot
-  fsNeededForBoot = fs: fs.neededForBoot
-                     || elem fs.mountPoint [ "/" "/nix" "/nix/store" "/var" "/var/log" "/var/lib" "/etc" ];
+  # Check whenever fileSystem is needed for boot.  NOTE: Make sure
+  # pathsNeededForBoot is closed under the parent relationship, i.e. if /a/b/c
+  # is in the list, put /a and /a/b in as well.
+  pathsNeededForBoot = [ "/" "/nix" "/nix/store" "/var" "/var/log" "/var/lib" "/etc" ];
+  fsNeededForBoot = fs: fs.neededForBoot || elem fs.mountPoint pathsNeededForBoot;
 
   # Check whenever `b` depends on `a` as a fileSystem
   fsBefore = a: b: a.mountPoint == b.device