summary refs log tree commit diff
path: root/nixos/modules/services/mail/dovecot.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-01-10 07:02:24 +0300
committerNikolay Amiantov <ab@fmap.me>2016-01-21 12:53:25 +0300
commit39bbac96afce0624b7ea57461431efcdabdd5fc8 (patch)
tree574c8347d0ddc1b9663bc5be721454617a4b208c /nixos/modules/services/mail/dovecot.nix
parent70e77f9b53b036edfc9300ce3a16ecc637c5f6c3 (diff)
downloadnixpkgs-39bbac96afce0624b7ea57461431efcdabdd5fc8.tar
nixpkgs-39bbac96afce0624b7ea57461431efcdabdd5fc8.tar.gz
nixpkgs-39bbac96afce0624b7ea57461431efcdabdd5fc8.tar.bz2
nixpkgs-39bbac96afce0624b7ea57461431efcdabdd5fc8.tar.lz
nixpkgs-39bbac96afce0624b7ea57461431efcdabdd5fc8.tar.xz
nixpkgs-39bbac96afce0624b7ea57461431efcdabdd5fc8.tar.zst
nixpkgs-39bbac96afce0624b7ea57461431efcdabdd5fc8.zip
nixos/dovecot: symlink system-wide config and use it
Diffstat (limited to 'nixos/modules/services/mail/dovecot.nix')
-rw-r--r--nixos/modules/services/mail/dovecot.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix
index 974dfb708f1..a2a93a520e9 100644
--- a/nixos/modules/services/mail/dovecot.nix
+++ b/nixos/modules/services/mail/dovecot.nix
@@ -201,6 +201,7 @@ in
       };
 
     environment.etc."dovecot/modules".source = modulesDir;
+    environment.etc."dovecot/dovecot.conf".source = cfg.configFile;
 
     systemd.services.dovecot2 = {
       description = "Dovecot IMAP/POP3 server";
@@ -208,10 +209,11 @@ in
       after = [ "keys.target" "network.target" ];
       wants = [ "keys.target" ];
       wantedBy = [ "multi-user.target" ];
+      restartTriggers = [ cfg.configFile ];
 
       serviceConfig = {
-        ExecStart = "${dovecotPkg}/sbin/dovecot -F -c ${cfg.configFile}";
-        ExecReload = "${dovecotPkg}/sbin/doveadm reload -c ${cfg.configFile}";
+        ExecStart = "${dovecotPkg}/sbin/dovecot -F";
+        ExecReload = "${dovecotPkg}/sbin/doveadm reload";
         Restart = "on-failure";
         RestartSec = "1s";
         StartLimitInterval = "1min";