nixos/dovecot: add mail user and group

This commit is contained in:
Nikolay Amiantov 2016-01-10 07:07:26 +03:00
parent b781cf1a12
commit 5b5e2c05c4

View File

@ -27,6 +27,8 @@ let
''
default_internal_user = ${cfg.user}
${optionalString (cfg.mailUser != null) "mail_uid = ${cfg.mailUser}"}
${optionalString (cfg.mailGroup != null) "mail_gid = ${cfg.mailGroup}"}
mail_location = ${cfg.mailLocation}
@ -135,6 +137,18 @@ in
'';
};
mailUser = mkOption {
type = types.nullOr types.str;
default = null;
description = "Default user to store mail for virtual users.";
};
mailGroup = mkOption {
type = types.nullOr types.str;
default = null;
description = "Default group to store mail for virtual users.";
};
modules = mkOption {
type = types.listOf types.package;
default = [];
@ -245,7 +259,7 @@ in
fi
${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/sieve/${to}'
'') cfg.sieveScripts)}
chown -R '${cfg.user}:${cfg.group}' ${stateDir}/sieve
chown -R '${cfg.mailUser}:${cfg.mailGroup}' '${stateDir}/sieve'
'';
};