mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-11-11 19:39:16 +05:00
remove deprecated types.loaOf
This commit is contained in:
parent
4008d0cb53
commit
e2ed4541d4
16
default.nix
16
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";
|
||||
|
Loading…
Reference in New Issue
Block a user