From 96824109c0a126536678cd2352f4c9ecd20b676c Mon Sep 17 00:00:00 2001 From: poscat Date: Thu, 2 Mar 2023 17:14:08 +0800 Subject: [PATCH] nixos: Allow configuring user and group names --- nixos/atticd.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nixos/atticd.nix b/nixos/atticd.nix index 24ddc69..a3ae98c 100644 --- a/nixos/atticd.nix +++ b/nixos/atticd.nix @@ -83,6 +83,20 @@ in type = types.nullOr types.path; default = null; }; + user = lib.mkOption { + description = '' + The group under which attic runs. + ''; + type = types.str; + default = "atticd"; + }; + group = lib.mkOption { + description = '' + The user under which attic runs. + ''; + type = types.str; + default = "atticd"; + }; settings = lib.mkOption { description = '' Structured configurations of atticd. @@ -156,6 +170,8 @@ in EnvironmentFile = cfg.credentialsFile; StateDirectory = "atticd"; # for usage with local storage and sqlite DynamicUser = true; + User = cfg.user; + Group = cfg.group; ProtectHome = true; ProtectHostname = true; ProtectKernelLogs = true;