mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 19:34:06 +00:00
Merge pull request #203621 from jooooscha/master
nixos/gollum: add options for user and group of gollum process
This commit is contained in:
commit
bc152fd1c1
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user