feat: fix all initial impermanence perm folder creation
Some checks failed
ci / treefmt (push) Failing after 4s

This commit is contained in:
Ceferino Patino 2026-07-01 00:24:52 -05:00
commit 0fd70dd3f8
Signed by: c4patino
SSH key fingerprint: SHA256:Wu+cU1t+7zVT9wzew/4meNmeulo66NzMqc22MdDBgXI
39 changed files with 184 additions and 207 deletions

View file

@ -354,4 +354,34 @@ with lib; rec {
## @return The host name where the service is defined.
resolveServiceHost = networkServices: serviceName:
(flattenHostServices networkServices).${serviceName}.host;
## Create an impermanence persistence directory owned by a service user.
##
## ```nix
## mkPersistDir config "forgejo" "/var/lib/forgejo"
## ```
##
## @param config The module config (passed from the module).
## @param username The service username (must exist in config.users.users).
## @param directory The directory path to persist.
## @return An attrset for the impermanence.folders list.
mkPersistDir = config: username: directory: let
u = config.users.users.${username};
in {
inherit directory;
user = u.name;
group = u.group;
mode = "700";
};
## Create an impermanence persistence directory owned by root.
##
## ```nix
## mkPersistRootDir config "/var/lib/docker"
## ```
##
## @param config The module config (passed from the module).
## @param directory The directory path to persist.
## @return An attrset for the impermanence.folders list.
mkPersistRootDir = config: directory: mkPersistDir config "root" directory;
}