From 8f57394cd2bd149c3b101fed0d122edf20b064e9 Mon Sep 17 00:00:00 2001 From: Colin Date: Sat, 8 Jul 2023 02:08:18 +0000 Subject: [PATCH] persist: create the backing path as a dependency of the VFS path --- modules/persist/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/persist/default.nix b/modules/persist/default.nix index bf55e4b6..baaf5165 100644 --- a/modules/persist/default.nix +++ b/modules/persist/default.nix @@ -235,15 +235,19 @@ in } (lib.optionalAttrs (opt.type == "dir") { # create the backing path as a dir - sane.fs."${fsPathToBackingPath fspath}".dir = { - acl = config.sane.fs."${fspath}".generated.acl; + sane.fs."${fsPathToBackingPath fspath}" = { + wantedBeforeBy = [ config.sane.fs."${fspath}".unit ]; + dir.acl = config.sane.fs."${fspath}".generated.acl; }; }) (lib.optionalAttrs (opt.type == "file") { # ensure the backing path of this file's parent exists. # XXX: this forces the backing parent to be a directory # this is almost always what is wanted, but it's sometimes an arbitrary constraint - sane.fs."${path.parent (fsPathToBackingPath fspath)}".dir = {}; + sane.fs."${path.parent (fsPathToBackingPath fspath)}" = { + wantedBeforeBy = [ config.sane.fs."${fspath}".unit ]; + dir = {}; + }; }) { # default each item along the backing path to have the same acl as the location it would be mounted.