Skip to content

Commit

Permalink
Merge pull request NixOS#203621 from jooooscha/master
Browse files Browse the repository at this point in the history
nixos/gollum: add options for user and group of gollum process
  • Loading branch information
erictapen authored Jun 27, 2023
2 parents 11e1b06 + 05885a1 commit bc152fd
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions nixos/modules/services/misc/gollum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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} - -"
Expand All @@ -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 \
Expand Down

0 comments on commit bc152fd

Please sign in to comment.