Wrap dovecot2 with services {}
This commit is contained in:
parent
d6dfd183cb
commit
292c0bad61
26
dovecot.nix
26
dovecot.nix
|
@ -188,17 +188,6 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services = {
|
||||
prometheus.exporters.dovecot = {
|
||||
enable = true;
|
||||
scopes = [ "user" "global" ];
|
||||
user = cfg.metrics.user;
|
||||
listenAddresses = "127.0.0.1";
|
||||
port = cfg.metrics.port;
|
||||
socketPath = "/var/run/dovecot2/old-stats";
|
||||
};
|
||||
};
|
||||
|
||||
users = {
|
||||
users = {
|
||||
"${cfg.mail-user}" = {
|
||||
|
@ -224,6 +213,16 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
prometheus.exporters.dovecot = {
|
||||
enable = true;
|
||||
scopes = [ "user" "global" ];
|
||||
user = cfg.metrics.user;
|
||||
listenAddresses = "127.0.0.1";
|
||||
port = cfg.metrics.port;
|
||||
socketPath = "/var/run/dovecot2/old-stats";
|
||||
};
|
||||
|
||||
dovecot2 = {
|
||||
enable = true;
|
||||
enableImap = true;
|
||||
|
@ -325,7 +324,9 @@ in {
|
|||
# All users map to one actual system user
|
||||
userdb {
|
||||
driver = static
|
||||
args = uid=${toString mailUserUid} home=${cfg.state-directory}/mail/%u
|
||||
args = uid=${
|
||||
toString mailUserUid
|
||||
} home=${cfg.state-directory}/mail/%u
|
||||
}
|
||||
|
||||
service imap {
|
||||
|
@ -387,4 +388,5 @@ in {
|
|||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue