summaryrefslogtreecommitdiffstats
path: root/mail-server
diff options
context:
space:
mode:
authorBrian Olsen <brian@maven-group.org>2020-06-19 16:02:21 +0200
committerBrian Olsen <brian@maven-group.org>2020-06-19 16:02:21 +0200
commiteb70dd1f55c0013a874aa96ed53117983ebf439a (patch)
treec68ff3d0fdf038b2770331d8eb873f4ddcda7fb1 /mail-server
parentfb8886547b569be3e6b72b526cea64c02424a5c4 (diff)
Fix passwfile update
Currently oneshot services are not re-run on NixOS activate and that meant that you needed to manually restart `gen-passwd-file` for new users to be available. This commit removes the `gen-passwd-file` service and instead simply calls the same script in the dovecot2 preStart.
Diffstat (limited to 'mail-server')
-rw-r--r--mail-server/dovecot.nix13
1 files changed, 2 insertions, 11 deletions
diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix
index 02d5a5d..fa7a3c8 100644
--- a/mail-server/dovecot.nix
+++ b/mail-server/dovecot.nix
@@ -199,18 +199,9 @@ in
'';
};
- systemd.services.gen-passwd-file = {
- serviceConfig = {
- ExecStart = genPasswdScript;
- Type = "oneshot";
- };
- };
-
systemd.services.dovecot2 = {
- after = [ "gen-passwd-file.service" ];
- wants = [ "gen-passwd-file.service" ];
- requires = [ "gen-passwd-file.service" ];
preStart = ''
+ ${genPasswdScript}
rm -rf '${stateDir}/imap_sieve'
mkdir '${stateDir}/imap_sieve'
cp -p "${./dovecot/imap_sieve}"/*.sieve '${stateDir}/imap_sieve/'
@@ -221,6 +212,6 @@ in
'';
};
- systemd.services.postfix.restartTriggers = [ passwdFile ];
+ systemd.services.postfix.restartTriggers = [ genPasswdScript ];
};
}