From 6ab5dd8a8f0f5e4f204483a9027d1896445473db Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 25 Feb 2024 07:51:24 +0000 Subject: [PATCH] modules/persist: ensure that the mountpoint for the private store is created at boot --- modules/persist/stores/private.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/persist/stores/private.nix b/modules/persist/stores/private.nix index 1e255030..6f54758c 100644 --- a/modules/persist/stores/private.nix +++ b/modules/persist/stores/private.nix @@ -45,7 +45,13 @@ lib.mkIf config.sane.persist.enable # let sane.fs know about the mount sane.fs."${origin}".mount = {}; # it also needs to know that the underlying device is an ordinary folder - sane.fs."${backing}".dir = {}; + sane.fs."${backing}" = sane-lib.fs.wantedDir; + # in order for non-systemd `mount` to work, the mount point has to already be created, so make that a default target + systemd.units = let + originUnit = config.sane.fs."${origin}".generated.unit; + in { + "${originUnit}".wantedBy = [ "local-fs.target" ]; + }; # TODO: could add this *specifically* to the .mount file for the encrypted fs? system.fsPackages = [ pkgs.gocryptfs ]; # fuse needs to find gocryptfs