From 52e9ddd3457998c0dd6d7c694d303adb0a4f6cad Mon Sep 17 00:00:00 2001 From: Joscha Loos Date: Tue, 29 Nov 2022 16:17:25 +0100 Subject: [PATCH 1/2] nixos/gollum: --- nixos/modules/services/misc/gollum.nix | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/misc/gollum.nix b/nixos/modules/services/misc/gollum.nix index 4eec9610b5e9..d0c0621fba2c 100644 --- a/nixos/modules/services/misc/gollum.nix +++ b/nixos/modules/services/misc/gollum.nix @@ -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.gollum = mkIf (cfg.group == "gollum") { }; 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 \ From 05885a166b4ee787693d28ce1b7f7c8ccdd79e71 Mon Sep 17 00:00:00 2001 From: jooooscha <57965027+jooooscha@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:26:22 +0100 Subject: [PATCH 2/2] Update nixos/modules/services/misc/gollum.nix Co-authored-by: Kerstin --- nixos/modules/services/misc/gollum.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/gollum.nix b/nixos/modules/services/misc/gollum.nix index d0c0621fba2c..b73528abaf65 100644 --- a/nixos/modules/services/misc/gollum.nix +++ b/nixos/modules/services/misc/gollum.nix @@ -114,7 +114,7 @@ in isSystemUser = true; }; - users.groups.gollum = mkIf (cfg.group == "gollum") { }; + users.groups."${cfg.group}" = { }; systemd.tmpfiles.rules = [ "d '${cfg.stateDir}' - ${config.users.users.gollum.name} ${config.users.groups.gollum.name} - -"