Wrap dovecot2 with services {}

This commit is contained in:
niten 2023-09-24 13:02:51 -07:00
parent d6dfd183cb
commit 292c0bad61
1 changed files with 164 additions and 162 deletions

View File

@ -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 {
'';
};
};
};
}