From a12f1c409d89cf680ff5e67ff336e18988269c21 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 27 Aug 2025 17:38:37 +0000 Subject: [PATCH] Copy glitchtip working files to a writeable directory It's not configurable, but it works, and was able to take my build system upload. --- modules/system/glitchtip/glitchtip.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/system/glitchtip/glitchtip.nix b/modules/system/glitchtip/glitchtip.nix index 9cc32ff..44ef94b 100644 --- a/modules/system/glitchtip/glitchtip.nix +++ b/modules/system/glitchtip/glitchtip.nix @@ -171,7 +171,8 @@ in wants = [ "network-online.target" ]; requires = - lib.optional cfg.database.createLocally "postgresql.service" + [ "glitchtip-setup.service" ] + ++ lib.optional cfg.database.createLocally "postgresql.service" ++ lib.optional cfg.redis.createLocally "redis-glitchtip.service"; after = [ "network-online.target" @@ -188,7 +189,7 @@ in RuntimeDirectory = "glitchtip"; StateDirectory = "glitchtip"; EnvironmentFile = cfg.environmentFiles; - WorkingDirectory = "${pkg}/lib/glitchtip"; + WorkingDirectory = "/var/lib/glitchtip"; # hardening AmbientCapabilities = ""; @@ -242,6 +243,17 @@ in }; }; + glitchtip-setup = { + description = "Setup GlitchTip working directory"; + 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"; + Restart="on-abort"; + }; + }; + glitchtip-worker = commonService // { description = "GlitchTip Job Runner";