diff --git a/module.nix b/module.nix index 940fd73..ea13498 100644 --- a/module.nix +++ b/module.nix @@ -18,10 +18,10 @@ in tor.enable = lib.mkEnableOption "Tor hidden service for the website"; - envFile = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - description = "Environment file containing QA_NOTIFY_EMAIL."; + qaNotifyEmail = lib.mkOption { + type = lib.types.str; + default = "jet@extremist.software"; + description = "Email address to receive Q&A notifications."; }; qaMailDomain = lib.mkOption { @@ -95,12 +95,13 @@ in serviceConfig = { DynamicUser = true; StateDirectory = "jetpham-qa"; - Environment = [ "QA_DB_PATH=/var/lib/jetpham-qa/qa.db" ]; + Environment = [ + "QA_DB_PATH=/var/lib/jetpham-qa/qa.db" + "QA_NOTIFY_EMAIL=${cfg.qaNotifyEmail}" + ]; Restart = "on-failure"; RestartSec = 5; LoadCredential = "webhook-secret:${config.age.secrets.webhook-secret.path}"; - } // lib.optionalAttrs (cfg.envFile != null) { - EnvironmentFile = cfg.envFile; }; script = '' export WEBHOOK_SECRET="$(cat $CREDENTIALS_DIRECTORY/webhook-secret)"