Inherit needed functions

This commit is contained in:
niten 2023-11-03 11:01:14 -07:00
parent 055bb037a0
commit d2c0c3074a
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,8 @@
with pkgs.lib;
let
inherit (pkgs.lib.ip) networkMinIp neworkMaxButOneIp ipv4OnNetwork;
range = base: top:
assert base < top;
let
@ -12,8 +14,7 @@ let
if base == top then [ ] else [ base ] ++ (rangeFun (base + 1) top);
in rangeFun base top;
getNetworkHosts = network:
selectAttrs (ip: _: pkgs.lib.ip.ipv4OnNetwork ip network);
getNetworkHosts = network: selectAttrs (ip: _: ipv4OnNetwork ip network);
getLastIpComponent = ip: head (reverseList (splitString "." ip));