nixos: apply toposort to fileSystems to support bind and move mounts

And use new `config.system.build.fileSystems` property everywhere.
This commit is contained in:
Jan Malakhovski 2015-11-25 19:09:09 +00:00
parent 2c8ca0d1bd
commit 65d26c4dc1
6 changed files with 43 additions and 19 deletions

View file

@ -2,6 +2,11 @@ pkgs: with pkgs.lib;
rec {
# 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))
|| (hasPrefix a.mountPoint b.mountPoint);
# Escape a path according to the systemd rules, e.g. /dev/xyzzy
# becomes dev-xyzzy. FIXME: slow.
escapeSystemdPath = s: