Merge pull request #203621 from jooooscha/master

nixos/gollum: add options for user and group of gollum process
This commit is contained in:
Kerstin 2023-06-27 15:49:45 +02:00 committed by GitHub
commit bc152fd1c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,18 +91,30 @@ in
The package used in the service
'';
};
user = mkOption {
type = types.str;
default = "gollum";
description = lib.mdDoc "Specifies the owner of the wiki directory";
};
group = mkOption {
type = types.str;
default = "gollum";
description = lib.mdDoc "Specifies the owner group of the wiki directory";
};
};
config = mkIf cfg.enable {
users.users.gollum = {
group = config.users.users.gollum.name;
users.users.gollum = mkIf (cfg.user == "gollum") {
group = cfg.group;
description = "Gollum user";
createHome = false;
isSystemUser = true;
};
users.groups.gollum = { };
users.groups."${cfg.group}" = { };
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' - ${config.users.users.gollum.name} ${config.users.groups.gollum.name} - -"
@ -120,8 +132,8 @@ in
'';
serviceConfig = {
User = config.users.users.gollum.name;
Group = config.users.groups.gollum.name;
User = cfg.user;
Group = cfg.group;
WorkingDirectory = cfg.stateDir;
ExecStart = ''
${cfg.package}/bin/gollum \