]> Git — Sourcephile - sourcephile-nix.git/blob - nixos/modules/services/mail/dovecot.nix
Add given password for hosts/carotte/nebula/carotte.key to store.
[sourcephile-nix.git] / nixos / modules / services / mail / dovecot.nix
1 { pkgs, lib, config, ... }:
2 let
3 inherit (pkgs.lib) unlinesValues;
4 inherit (config.services) dovecot2;
5 stateDir = "/var/lib/dovecot";
6 in
7 {
8 config = lib.mkIf dovecot2.enable {
9 systemd.services.dovecot2 = {
10 preStart = unlinesValues {
11 installDomains = ''
12 # SEE: http://wiki2.dovecot.org/SharedMailboxes/Permissions
13 install -D -d -m 0771 \
14 -o "${dovecot2.user}" \
15 -g "${dovecot2.group}" \
16 ${stateDir}/mail
17 '';
18 };
19 };
20 };
21 }