From c1446b9e512bed33c63b33998cc01b7c4f040623 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 27 Aug 2025 17:51:18 +0000 Subject: [PATCH] Make the working directory for Glitchtip configurable --- modules/system/glitchtip/glitchtip.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/system/glitchtip/glitchtip.nix b/modules/system/glitchtip/glitchtip.nix index 44ef94b..98f0cc4 100644 --- a/modules/system/glitchtip/glitchtip.nix +++ b/modules/system/glitchtip/glitchtip.nix @@ -58,6 +58,12 @@ in default = 8000; }; + workingDirectory = lib.mkOption { + type = lib.types.str; + description = "The working directory for the GlitchTip services. It will receive user upload data when using the default local filesystem storage."; + default = "/var/lib/glitchtip"; + }; + settings = lib.mkOption { description = '' Configuration of GlitchTip. See for more information. @@ -189,7 +195,7 @@ in RuntimeDirectory = "glitchtip"; StateDirectory = "glitchtip"; EnvironmentFile = cfg.environmentFiles; - WorkingDirectory = "/var/lib/glitchtip"; + WorkingDirectory = cfg.workingDirectory; # hardening AmbientCapabilities = ""; @@ -248,8 +254,8 @@ in serviceConfig = { Type = "simple"; #${lib.getExe python.pkgs.gunicorn} \ - ExecStartPre="${lib.getExe' pkgs.coreutils "cp"} -pur ${pkg}/lib/glitchtip /var/lib"; - ExecStart="/run/current-system/sw/bin/chown -R glitchtip: /var/lib/glitchtip"; + ExecStartPre="${lib.getExe' pkgs.coreutils "cp"} -pur ${pkg}/lib/glitchtip ${cfg.workingDirectory}"; + ExecStart="/run/current-system/sw/bin/chown -R glitchtip: ${cfg.workingDirectory}"; Restart="on-abort"; }; }; @@ -283,7 +289,6 @@ in users.users = lib.mkIf (cfg.user == "glitchtip") { glitchtip = { - home = "/var/lib/glitchtip"; group = cfg.group; extraGroups = lib.optionals cfg.redis.createLocally [ "redis-glitchtip" ]; isSystemUser = true;