From 35be9c66bfa6dd03437f919ec610aed0e9b20b58 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Dec 2018 00:34:32 +0100 Subject: lib.normalize-ip6-addr: no :: for single section --- lib/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/default.nix b/lib/default.nix index 64b2d48a..347830e8 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -93,7 +93,13 @@ let in if max.pos == 0 then a - else "${concatStringsSep ":" lhs}::${concatStringsSep ":" rhs}"; + else let + sep = + if 8 - (length lhs + length rhs) == 1 + then ":0:" + else "::"; + in + "${concatStringsSep ":" lhs}${sep}${concatStringsSep ":" rhs}"; drop-leading-zeros = let -- cgit v1.2.3