diff options
-rw-r--r-- | lib/types.nix | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/types.nix b/lib/types.nix index d6d524377..c50969de7 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -135,11 +135,10 @@ rec { }; prefix = mkOption ({ type = cidr4; - } // optionalAttrs (config._module.args.name == "retiolum") { - default = "10.243.0.0/16"; - } // optionalAttrs (config._module.args.name == "wiregrill") { - default = "10.244.0.0/16"; - }); + } // { + retiolum.default = "10.243.0.0/16"; + wiregrill.default = "10.244.0.0/16"; + }.${config._module.args.name} or {}); }; }); default = null; @@ -153,11 +152,10 @@ rec { }; prefix = mkOption ({ type = cidr6; - } // optionalAttrs (config._module.args.name == "retiolum") { - default = "42::/16"; - } // optionalAttrs (config._module.args.name == "wiregrill") { - default = "42:1::/32"; - }); + } // { + retiolum.default = "42:0::/32"; + wiregrill.default = "42:1::/32"; + }.${config._module.args.name} or {}); }; }); default = null; |