diff options
author | Casey Link <unnamedrambler@gmail.com> | 2024-04-10 17:30:55 +0200 |
---|---|---|
committer | Casey Link <unnamedrambler@gmail.com> | 2024-04-11 08:19:24 +0200 |
commit | 789684ad02f78823a485b9ff3d49db0219520ba4 (patch) | |
tree | 9e56fa8709e0e5551213d1fbbff4246bc647fb58 /nixos/modules/services/misc | |
parent | 9532793d59f929073f8ed4cf61d1580f5b75fe02 (diff) |
nixos/paperless: Switch to `systemd.tmpfiles.settings`
This option resolves #301746 by allowing the admin to bypass the
creation of the paperless directories by systemd-tmpfiles.
This is necessary when, for example, those directories lie inside an NFS
mount that the root user does not have rw access to.
Fixes #301746
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r-- | nixos/modules/services/misc/paperless.nix | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nixos/modules/services/misc/paperless.nix b/nixos/modules/services/misc/paperless.nix index 1a2b5f45b2f7..9a81fdde62af 100644 --- a/nixos/modules/services/misc/paperless.nix +++ b/nixos/modules/services/misc/paperless.nix @@ -220,15 +220,16 @@ in config = mkIf cfg.enable { services.redis.servers.paperless.enable = mkIf enableRedis true; - systemd.tmpfiles.rules = [ - "d '${cfg.dataDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -" - "d '${cfg.mediaDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -" - (if cfg.consumptionDirIsPublic then - "d '${cfg.consumptionDir}' 777 - - - -" - else - "d '${cfg.consumptionDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -" - ) - ]; + systemd.tmpfiles.settings."10-paperless" = let + defaultRule = { + inherit (cfg) user; + inherit (config.users.users.${cfg.user}) group; + }; + in { + "${cfg.dataDir}".d = defaultRule; + "${cfg.mediaDir}".d = defaultRule; + "${cfg.consumptionDir}".d = if cfg.consumptionDirIsPublic then { mode = "777"; } else defaultRule; + }; systemd.services.paperless-scheduler = { description = "Paperless Celery Beat"; |