nixpkgs/modules/services/mail/spamassassin.nix
Peter Simons 1b249eaf05 Initial version of a SpamAssassin service.
The configuration is expected to be managed by the user in /etc/spamassassin.
2012-08-03 15:11:28 +02:00

46 lines
773 B
Nix

{ 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 {
# This makes comfortable for users to run 'spamassassin'.
environment.systemPackages = [ pkgs.spamassassin ];
jobs.spamd = {
description = "Spam Assassin Server";
startOn = "started networking and filesystem";
environment.TZ = config.time.timeZone;
exec = "spamd -C /etc/spamassassin/init.pre --siteconfigpath=/etc/spamassassin --debug --pidfile=/var/run/spamd.pid";
};
};
}