From 3ddb425e39fb698bb1fc226e8e6623c33a6f560d Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Sun, 21 Nov 2021 13:47:53 +0100
Subject: [PATCH] types net: fix retiolum's ipv6 prefix

---
 lib/types.nix | 18 ++++++++----------
 1 file 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;