nixos/dovecot: symlink system-wide config and use it

This commit is contained in:
Nikolay Amiantov 2016-01-10 07:02:24 +03:00
parent 70e77f9b53
commit 39bbac96af

View file

@ -201,6 +201,7 @@ in
}; };
environment.etc."dovecot/modules".source = modulesDir; environment.etc."dovecot/modules".source = modulesDir;
environment.etc."dovecot/dovecot.conf".source = cfg.configFile;
systemd.services.dovecot2 = { systemd.services.dovecot2 = {
description = "Dovecot IMAP/POP3 server"; description = "Dovecot IMAP/POP3 server";
@ -208,10 +209,11 @@ in
after = [ "keys.target" "network.target" ]; after = [ "keys.target" "network.target" ];
wants = [ "keys.target" ]; wants = [ "keys.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
restartTriggers = [ cfg.configFile ];
serviceConfig = { serviceConfig = {
ExecStart = "${dovecotPkg}/sbin/dovecot -F -c ${cfg.configFile}"; ExecStart = "${dovecotPkg}/sbin/dovecot -F";
ExecReload = "${dovecotPkg}/sbin/doveadm reload -c ${cfg.configFile}"; ExecReload = "${dovecotPkg}/sbin/doveadm reload";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "1s"; RestartSec = "1s";
StartLimitInterval = "1min"; StartLimitInterval = "1min";