diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-26 16:50:29 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-26 16:50:29 +0100 |
commit | 9f0280c6f8b2d61d4eb2607b5da93581e6358d16 (patch) | |
tree | c375517610973b8106406a97325410d83e0e9a84 /modules/certspotter.nix | |
parent | 905c3efd03ec76e6b5289495bb81d59de02b5c30 (diff) | |
download | nixos-9f0280c6f8b2d61d4eb2607b5da93581e6358d16.tar nixos-9f0280c6f8b2d61d4eb2607b5da93581e6358d16.tar.gz nixos-9f0280c6f8b2d61d4eb2607b5da93581e6358d16.tar.bz2 nixos-9f0280c6f8b2d61d4eb2607b5da93581e6358d16.tar.xz nixos-9f0280c6f8b2d61d4eb2607b5da93581e6358d16.zip |
...
Diffstat (limited to 'modules/certspotter.nix')
-rw-r--r-- | modules/certspotter.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/certspotter.nix b/modules/certspotter.nix index 8d49b9e9..70c28b74 100644 --- a/modules/certspotter.nix +++ b/modules/certspotter.nix | |||
@@ -5,9 +5,19 @@ with lib; | |||
5 | let | 5 | let |
6 | cfg = config.services.certspotter; | 6 | cfg = config.services.certspotter; |
7 | 7 | ||
8 | script = pkgs.writeShellApplication { | ||
9 | name = "certspotter-script"; | ||
10 | runtimeInputs = with pkgs; [ coreutils ]; | ||
11 | text = '' | ||
12 | mkdir -p "''${LOGS_DIRECTORY}" | ||
13 | env > $(mktemp -p "''${LOGS_DIRECTORY}" $(date -Ins).XXXXXXXXXX.env) | ||
14 | ''; | ||
15 | }; | ||
16 | |||
8 | startOptions = cfg.extraOptions | 17 | startOptions = cfg.extraOptions |
9 | ++ optionals (cfg.logs != null) ["-logs" cfg.logs] | 18 | ++ optionals (cfg.logs != null) ["-logs" cfg.logs] |
10 | ++ ["-watchlist" (pkgs.writeText "watchlist" (concatStringsSep "\n" cfg.watchList)) | 19 | ++ ["-watchlist" (pkgs.writeText "watchlist" (concatStringsSep "\n" cfg.watchList)) |
20 | "-script" "${script}/bin/certspotter-script" | ||
11 | ]; | 21 | ]; |
12 | in { | 22 | in { |
13 | options = { | 23 | options = { |
@@ -39,7 +49,6 @@ in { | |||
39 | ExecStart = "${cfg.package}/bin/certspotter -state_dir $STATE_DIRECTORY ${escapeShellArgs startOptions}"; | 49 | ExecStart = "${cfg.package}/bin/certspotter -state_dir $STATE_DIRECTORY ${escapeShellArgs startOptions}"; |
40 | StateDirectory = "certspotter"; | 50 | StateDirectory = "certspotter"; |
41 | LogsDirectory = "certspotter"; | 51 | LogsDirectory = "certspotter"; |
42 | StandardOutput = "append:$LOGS_DIRECTORY/certspotter.log"; | ||
43 | DynamicUser = true; | 52 | DynamicUser = true; |
44 | }; | 53 | }; |
45 | }; | 54 | }; |