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.
This commit is contained in:
parent
fb8886547b
commit
eb70dd1f55
|
@ -199,18 +199,9 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.gen-passwd-file = {
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = genPasswdScript;
|
|
||||||
Type = "oneshot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.dovecot2 = {
|
systemd.services.dovecot2 = {
|
||||||
after = [ "gen-passwd-file.service" ];
|
|
||||||
wants = [ "gen-passwd-file.service" ];
|
|
||||||
requires = [ "gen-passwd-file.service" ];
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
|
${genPasswdScript}
|
||||||
rm -rf '${stateDir}/imap_sieve'
|
rm -rf '${stateDir}/imap_sieve'
|
||||||
mkdir '${stateDir}/imap_sieve'
|
mkdir '${stateDir}/imap_sieve'
|
||||||
cp -p "${./dovecot/imap_sieve}"/*.sieve '${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 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue