nixos: Allow configuring user and group names

This commit is contained in:
poscat 2023-03-02 17:14:08 +08:00
parent 0bb3d00136
commit 96824109c0
No known key found for this signature in database

View file

@ -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;