diff options
author | Matt Votava <mvnetbiz@gmail.com> | 2020-09-13 06:12:14 -0700 |
---|---|---|
committer | Matt Votava <mvnetbiz@gmail.com> | 2020-09-13 06:12:14 -0700 |
commit | e2ed4541d49676aa1b56fc683967fd84f624ea84 (patch) | |
tree | 8d9ae757aa38ac4784a39158d00835fc44fb300f /default.nix | |
parent | 4008d0cb53b9abd00d2dc568814566227ddd3825 (diff) |
remove deprecated types.loaOf
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/default.nix b/default.nix index 02a0348..bfddc3e 100644 --- a/default.nix +++ b/default.nix @@ -47,7 +47,7 @@ in }; loginAccounts = mkOption { - type = types.loaOf (types.submodule ({ name, ... }: { + type = types.attrsOf (types.submodule ({ name, ... }: { options = { name = mkOption { type = types.str; @@ -193,14 +193,12 @@ in }; extraVirtualAliases = mkOption { - type = types.loaOf (mkOptionType { - name = "Login Account"; - check = (ele: - let accounts = builtins.attrNames cfg.loginAccounts; - in if (builtins.isList ele) - then (builtins.all (x: builtins.elem x accounts) ele) && (builtins.length ele > 0) - else (builtins.elem ele accounts)); - }); + type = let + loginAccount = mkOptionType { + name = "Login Account"; + check = (account: builtins.elem account (builtins.attrNames cfg.loginAccounts)); + }; + in with types; attrsOf (either loginAccount (nonEmptyListOf loginAccount)); example = { "info@example.com" = "user1@example.com"; "postmaster@example.com" = "user1@example.com"; |