diff options
author | Jan Malakhovski <oxij@oxij.org> | 2016-08-23 18:01:35 +0000 |
---|---|---|
committer | Jan Malakhovski <oxij@oxij.org> | 2016-08-23 18:14:06 +0000 |
commit | b267785c43547dbe854c994a91b9f012c9b7812f (patch) | |
tree | cb88b704712effa94316c631da785b2317e35c10 /nixos/lib/utils.nix | |
parent | 8da59c406cea9ee3fbe37fce6211421281c47b78 (diff) | |
download | nixpkgs-b267785c43547dbe854c994a91b9f012c9b7812f.tar nixpkgs-b267785c43547dbe854c994a91b9f012c9b7812f.tar.gz nixpkgs-b267785c43547dbe854c994a91b9f012c9b7812f.tar.bz2 nixpkgs-b267785c43547dbe854c994a91b9f012c9b7812f.tar.lz nixpkgs-b267785c43547dbe854c994a91b9f012c9b7812f.tar.xz nixpkgs-b267785c43547dbe854c994a91b9f012c9b7812f.tar.zst nixpkgs-b267785c43547dbe854c994a91b9f012c9b7812f.zip |
nixos: generalize copy-paste from stage-1 and zfs to utils
Diffstat (limited to 'nixos/lib/utils.nix')
-rw-r--r-- | nixos/lib/utils.nix | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 56a1e8a1d8b..1ef915d4061 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -2,6 +2,10 @@ 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 `b` depends on `a` as a fileSystem # FIXME: it's incorrect to simply use hasPrefix here: "/dev/a" is not a parent of "/dev/ab" fsBefore = a: b: ((any (x: elem x [ "bind" "move" ]) b.options) && (a.mountPoint == b.device)) |