Qualify user names

This commit is contained in:
John Boehr 2017-11-09 14:17:03 -08:00
parent bbca0bd678
commit f372754052
No known key found for this signature in database
GPG key ID: 73B8EFB60708F699
7 changed files with 30 additions and 23 deletions

View file

@ -19,6 +19,8 @@
with config.mailserver;
let
qualifyUser = (import ./common.nix { inherit config lib; }).qualifyUser;
vmail_user = {
name = vmailUserName;
isNormalUser = false;
@ -30,14 +32,14 @@ let
# accountsToUser :: String -> UserRecord
accountsToUser = account: {
name = account.name;
name = (qualifyUser account.name);
isNormalUser = false;
group = vmailGroupName;
inherit (account) hashedPassword;
};
# mail_users :: { [String]: UserRecord }
mail_users = lib.foldl (prev: next: prev // { "${next.name}" = next; }) {}
mail_users = lib.foldl (prev: next: prev // { "${qualifyUser next.name}" = next; }) {}
(map accountsToUser (lib.attrValues loginAccounts));
in