2012-08-03 13:11:28 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.spamassassin;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.spamassassin = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to run the SpamAssassin daemon.";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
2012-08-03 16:07:06 +00:00
|
|
|
# Allow users to run 'spamc'.
|
2012-08-03 13:11:28 +00:00
|
|
|
environment.systemPackages = [ pkgs.spamassassin ];
|
|
|
|
|
|
|
|
jobs.spamd = {
|
|
|
|
description = "Spam Assassin Server";
|
|
|
|
startOn = "started networking and filesystem";
|
|
|
|
environment.TZ = config.time.timeZone;
|
2012-08-03 16:07:06 +00:00
|
|
|
exec = "${pkgs.spamassassin}/bin/spamd -C /etc/spamassassin/init.pre --siteconfigpath=/etc/spamassassin --debug --pidfile=/var/run/spamd.pid";
|
2012-08-03 13:11:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|