From 39105a7501f7408ae73082af9bcd496c566f2aab Mon Sep 17 00:00:00 2001 From: Roman Stein Date: Mon, 26 Jan 2026 20:44:11 +0100 Subject: [PATCH] nixos/rspamd: Add extraArgs option to rspamd module Add extraArgs option to pass additional command-line arguments to rspamd, allowing variables to be defined for use in UCL configuration files. --- nixos/modules/services/mail/rspamd.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/rspamd.nix b/nixos/modules/services/mail/rspamd.nix index 715376e24f88..189d2c078e0d 100644 --- a/nixos/modules/services/mail/rspamd.nix +++ b/nixos/modules/services/mail/rspamd.nix @@ -383,6 +383,18 @@ in ''; }; + extraArgs = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ + "--var=RBL_API_KEY=\${RBL_API_KEY}" + ]; + description = '' + A list of extra command line arguments to pass to rspamd. + Check `rspamd --help` for possible arguments. + ''; + }; + user = mkOption { type = types.str; default = "rspamd"; @@ -478,7 +490,7 @@ in restartTriggers = [ rspamdDir ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/rspamd ${optionalString cfg.debug "-d"} -c /etc/rspamd/rspamd.conf -f"; + ExecStart = "${cfg.package}/bin/rspamd ${optionalString cfg.debug "-d"} ${escapeShellArgs cfg.extraArgs} -c /etc/rspamd/rspamd.conf -f"; Restart = "always"; User = "${cfg.user}";