2024-07-29 22:02:40 +02:00
|
|
|
{lib}: let
|
2024-06-21 00:47:03 +02:00
|
|
|
net = import ./net.nix {inherit lib;};
|
2024-07-29 22:02:40 +02:00
|
|
|
in {
|
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
|
|
|
|
2024-07-29 22:02:40 +02:00
|
|
|
calcSystemdDhcpPoolOffset = {
|
|
|
|
base,
|
|
|
|
start,
|
|
|
|
end,
|
|
|
|
}: {
|
2024-06-21 00:47:03 +02:00
|
|
|
offset = net.lib.net.ip.diff start base;
|
|
|
|
size = net.lib.net.ip.diff end start;
|
|
|
|
};
|
2024-06-01 04:05:06 +02:00
|
|
|
}
|