remove deprecated types.loaOf

This commit is contained in:
Matt Votava 2020-09-13 06:12:14 -07:00
parent 4008d0cb53
commit e2ed4541d4
1 changed files with 7 additions and 9 deletions

View File

@ -47,7 +47,7 @@ in
}; };
loginAccounts = mkOption { loginAccounts = mkOption {
type = types.loaOf (types.submodule ({ name, ... }: { type = types.attrsOf (types.submodule ({ name, ... }: {
options = { options = {
name = mkOption { name = mkOption {
type = types.str; type = types.str;
@ -193,14 +193,12 @@ in
}; };
extraVirtualAliases = mkOption { extraVirtualAliases = mkOption {
type = types.loaOf (mkOptionType { type = let
loginAccount = mkOptionType {
name = "Login Account"; name = "Login Account";
check = (ele: check = (account: builtins.elem account (builtins.attrNames cfg.loginAccounts));
let accounts = builtins.attrNames cfg.loginAccounts; };
in if (builtins.isList ele) in with types; attrsOf (either loginAccount (nonEmptyListOf loginAccount));
then (builtins.all (x: builtins.elem x accounts) ele) && (builtins.length ele > 0)
else (builtins.elem ele accounts));
});
example = { example = {
"info@example.com" = "user1@example.com"; "info@example.com" = "user1@example.com";
"postmaster@example.com" = "user1@example.com"; "postmaster@example.com" = "user1@example.com";