2024-06-21 00:47:03 +02:00
|
|
|
{lib}:let
|
|
|
|
net = import ./net.nix {inherit lib;};
|
|
|
|
in
|
|
|
|
{
|
2024-06-20 00:13:25 +02:00
|
|
|
|
2024-06-01 04:05:06 +02:00
|
|
|
dirToStrings = dir: (map (v: builtins.readFile "${dir}/${v}")
|
|
|
|
(builtins.filter (v:
|
|
|
|
(builtins.readFileType "${dir}/${v}") == "regular") (
|
|
|
|
if (builtins.pathExists dir && (builtins.readFileType dir) == "directory")
|
|
|
|
then
|
|
|
|
builtins.attrNames (
|
|
|
|
builtins.readDir dir
|
|
|
|
)
|
|
|
|
else []
|
|
|
|
)));
|
2024-06-21 00:47:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
calcSystemdDhcpPoolOffset = {base, start, end}: {
|
|
|
|
offset = net.lib.net.ip.diff start base;
|
|
|
|
size = net.lib.net.ip.diff end start;
|
|
|
|
};
|
2024-06-01 04:05:06 +02:00
|
|
|
}
|