diff options
author | Tristan Daniël Maat <tm@tlater.net> | 2023-10-07 01:21:21 +0200 |
---|---|---|
committer | Tristan Daniël Maat <tm@tlater.net> | 2023-10-07 21:53:02 +0200 |
commit | b59e5a34e782478445b6ea690fd546c8624ed705 (patch) | |
tree | 96230718d8142ed250e09659919f8c7cc44d2f13 /nixos/modules | |
parent | 4d675aec00a1883f872df2a15412d15f2685d758 (diff) | |
download | nixlib-b59e5a34e782478445b6ea690fd546c8624ed705.tar nixlib-b59e5a34e782478445b6ea690fd546c8624ed705.tar.gz nixlib-b59e5a34e782478445b6ea690fd546c8624ed705.tar.bz2 nixlib-b59e5a34e782478445b6ea690fd546c8624ed705.tar.lz nixlib-b59e5a34e782478445b6ea690fd546c8624ed705.tar.xz nixlib-b59e5a34e782478445b6ea690fd546c8624ed705.tar.zst nixlib-b59e5a34e782478445b6ea690fd546c8624ed705.zip |
nixos/gitea: Add option to supply the metrics token via file
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/misc/gitea.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index f6ef2bb91910..3f690f85d623 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -246,6 +246,13 @@ in description = lib.mdDoc "Path to a file containing the SMTP password."; }; + metricsTokenFile = mkOption { + type = types.nullOr types.str; + default = null; + example = "/var/lib/secrets/gitea/metrics_token"; + description = lib.mdDoc "Path to a file containing the metrics authentication token."; + }; + settings = mkOption { default = {}; description = lib.mdDoc '' @@ -433,6 +440,10 @@ in PASSWD = "#mailerpass#"; }; + metrics = mkIf (cfg.metricsTokenFile != null) { + TOKEN = "#metricstoken#"; + }; + oauth2 = { JWT_SECRET = "#oauth2jwtsecret#"; }; @@ -559,6 +570,10 @@ in ${lib.optionalString (cfg.mailerPasswordFile != null) '' ${replaceSecretBin} '#mailerpass#' '${cfg.mailerPasswordFile}' '${runConfig}' ''} + + ${lib.optionalString (cfg.metricsTokenFile != null) '' + ${replaceSecretBin} '#metricstoken#' '${cfg.metricsTokenFile}' '${runConfig}' + ''} chmod u-w '${runConfig}' } (umask 027; gitea_setup) |