From e7f2096f8d193c20740d481fdf29151f8da08c5a Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Thu, 2 Jan 2025 22:03:55 -0600 Subject: sys/net: switch gate0 to public subnet 2a03:3b40:fe:888::/64 --- sys/net/options.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/net/options.nix b/sys/net/options.nix index 292989a..a0d29d5 100644 --- a/sys/net/options.nix +++ b/sys/net/options.nix @@ -81,9 +81,17 @@ with lib; { config = { address = - if v6config.bits != 0 - then "${v6config.prefix}::${config.suffix}" - else config.suffix; + let + hextets = fragment: length (splitString ":" fragment); + separator = if doubleColon then "::" else ":"; + doubleColon = hextets v6config.prefix + hextets config.suffix < 8; + + joined = + if v6config.bits != 0 + then "${v6config.prefix}${separator}${config.suffix}" + else config.suffix; + in + joined; cidr = "${config.address}/${toString v6config.bits}"; single = "${config.address}/128"; -- cgit v1.2.3