From 891fa83f014efe3d18c39d9e9a76fc2f3ae000cb Mon Sep 17 00:00:00 2001 From: chayleaf Date: Wed, 25 Oct 2023 04:34:15 +0700 Subject: [PATCH] certspotter: switch to using StateDirectory --- system/hosts/server/default.nix | 2 +- system/modules/certspotter.nix | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/system/hosts/server/default.nix b/system/hosts/server/default.nix index 99b77c8..ca1ed1a 100644 --- a/system/hosts/server/default.nix +++ b/system/hosts/server/default.nix @@ -229,7 +229,7 @@ in { }; settings = { federation.ENABLED = true; - git.timeout = { + "git.timeout" = { DEFAULT = 6000; MIGRATE = 6000; MIRROR = 6000; diff --git a/system/modules/certspotter.nix b/system/modules/certspotter.nix index 64b02a5..3f53723 100644 --- a/system/modules/certspotter.nix +++ b/system/modules/certspotter.nix @@ -100,13 +100,16 @@ in { name = "hook${toString i}"; }) cfg.hooks); }); - environment.CERTSPOTTER_STATE_DIR = "/var/lib/certspotter"; serviceConfig = { User = "certspotter"; Group = "certspotter"; - WorkingDirectory = "/var/lib/certspotter"; - ExecStart = "${pkgs.certspotter}/bin/certspotter -sendmail ${cfg.sendmailPath} ${lib.escapeShellArgs cfg.extraFlags}"; + StateDirectory = "certspotter"; }; + script = '' + export CERTSPOTTER_STATE_DIR="$STATE_DIR" + cd "$CERTSPOTTER_STATE_DIR" + ${pkgs.certspotter}/bin/certspotter -sendmail ${cfg.sendmailPath} ${lib.escapeShellArgs cfg.extraFlags} + ''; }; }; }