commit
08f14b33c1
@ -0,0 +1,45 @@ |
||||
{ 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 { |
||||
|
||||
# Allow users to run 'spamc'. |
||||
environment.systemPackages = [ pkgs.spamassassin ]; |
||||
|
||||
jobs.spamd = { |
||||
description = "Spam Assassin Server"; |
||||
startOn = "started networking and filesystem"; |
||||
environment.TZ = config.time.timeZone; |
||||
exec = "${pkgs.spamassassin}/bin/spamd -C /etc/spamassassin/init.pre --siteconfigpath=/etc/spamassassin --debug --pidfile=/var/run/spamd.pid"; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
} |
@ -0,0 +1,28 @@ |
||||
{ config, pkgs, ... }: |
||||
|
||||
let |
||||
configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n" |
||||
(map (builtins.getAttr "configLine") config.system.requiredKernelConfig)) |
||||
); |
||||
|
||||
origKernel = pkgs.linuxManualConfig { |
||||
inherit (pkgs.linux) src version; |
||||
inherit configfile; |
||||
allowImportFromDerivation = true; |
||||
kernelPatches = [ pkgs.kernelPatches.cifs_timeout_2_6_38 ]; |
||||
}; |
||||
|
||||
kernel = origKernel // (derivation (origKernel.drvAttrs // { |
||||
configurePhase = '' |
||||
runHook preConfigure |
||||
mkdir ../build |
||||
make $makeFlags "''${makeFlagsArray[@]}" mrproper |
||||
make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig |
||||
runHook postConfigure |
||||
''; |
||||
})); |
||||
|
||||
kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages; |
||||
in { |
||||
boot.kernelPackages = kernelPackages; |
||||
} |
Loading…
Reference in new issue