nixos: generalize copy-paste from stage-1 and zfs to utils

This commit is contained in:
Jan Malakhovski 2016-08-23 18:01:35 +00:00
parent 8da59c406c
commit b267785c43
3 changed files with 6 additions and 6 deletions

View file

@ -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))