From 94d932389b58fde9ef77807f22146a1e7f3f244c Mon Sep 17 00:00:00 2001 From: niten Date: Fri, 3 Nov 2023 13:35:36 -0700 Subject: [PATCH] Use lib for getNetworkBase/Mask --- reverse-zone.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reverse-zone.nix b/reverse-zone.nix index 07461a3..9f1c46c 100644 --- a/reverse-zone.nix +++ b/reverse-zone.nix @@ -6,7 +6,8 @@ with pkgs.lib; let - inherit (pkgs.lib.ip) networkMinIp networkMaxButOneIp ipv4OnNetwork; + inherit (pkgs.lib.ip) + networkMinIp networkMaxButOneIp ipv4OnNetwork getNetworkMask getNetworkBase; range = base: top: assert base < top; @@ -22,8 +23,8 @@ let getNetworkZoneName = network: let netElems = splitString "/" network; - netIp = elemAt netElems 0; - netMask = elemAt netElems 1; + netIp = getNetworkBase network; + netMask = getNetworkMask network; reversedNetIp = concatStringsSep "." (tail (reverseList (splitString "." netIp))); in if netMask == "24" then