diff options
author | Jan Malakhovski <oxij@oxij.org> | 2015-11-25 19:09:09 +0000 |
---|---|---|
committer | Jan Malakhovski <oxij@oxij.org> | 2016-08-23 18:14:05 +0000 |
commit | 65d26c4dc12f8f0113b6b128573f18492ac5b6f6 (patch) | |
tree | bcd427c83dab4633c9c4b06c338ac10350f0209e /nixos/lib/utils.nix | |
parent | 2c8ca0d1bd1df838b3e3b2d2e17c6855b3b520c1 (diff) | |
download | nixpkgs-65d26c4dc12f8f0113b6b128573f18492ac5b6f6.tar nixpkgs-65d26c4dc12f8f0113b6b128573f18492ac5b6f6.tar.gz nixpkgs-65d26c4dc12f8f0113b6b128573f18492ac5b6f6.tar.bz2 nixpkgs-65d26c4dc12f8f0113b6b128573f18492ac5b6f6.tar.lz nixpkgs-65d26c4dc12f8f0113b6b128573f18492ac5b6f6.tar.xz nixpkgs-65d26c4dc12f8f0113b6b128573f18492ac5b6f6.tar.zst nixpkgs-65d26c4dc12f8f0113b6b128573f18492ac5b6f6.zip |
nixos: apply toposort to fileSystems to support bind and move mounts
And use new `config.system.build.fileSystems` property everywhere.
Diffstat (limited to 'nixos/lib/utils.nix')
-rw-r--r-- | nixos/lib/utils.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 40d0854d968..56a1e8a1d8b 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -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: |