NixOS configuration for HPC cluster https://docs.hpc.informatik.hs-fulda.de/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

106 lines
2.8 KiB

{ pkgs, lib, config, nodes, ... }:
with lib;
{
services.kea = {
dhcp4 = {
enable = true;
settings = {
"valid-lifetime" = 4000;
"renew-timer" = 1000;
"rebind-timer" = 2000;
"interfaces-config" = {
"interfaces" = [ "mngt" "data" ];
};
"lease-database" = {
"type" = "memfile";
"persist" = true;
"name" = "/var/lib/kea/dhcp4.leases";
};
"subnet4" = [
{
"subnet" = "10.32.46.0/24";
"interface" = "mngt";
"option-data" = [
{
"name" = "routers";
"data" = "10.32.46.1";
}
{
"name" = "domain-name-servers";
"data" = "10.0.0.53,10.1.1.10";
}
{
"name" = "domain-name";
"data" = "mngt.${config.networking.domain}";
}
{
"name" = "domain-search";
"data" = "mngt.${config.networking.domain}";
}
];
"pools" = [
{
"pool" = "10.32.46.100-10.32.46.200";
}
];
"reservations" = concatLists (mapAttrsToList
(_: node: optional
(node.config.networking.interfaces."mngt".macAddress != null)
{
"hw-address" = node.config.networking.interfaces."mngt".macAddress;
"ip-address" = "10.32.46.${toString (100 + node.options._module.args.value.nodeId)}";
})
nodes);
}
{
"subnet" = "10.32.47.0/24";
"interface" = "data";
"option-data" = [
{
"name" = "routers";
"data" = "10.32.47.1";
}
{
"name" = "domain-name-servers";
"data" = "10.0.0.53,10.1.1.10";
}
{
"name" = "domain-name";
"data" = config.networking.domain;
}
{
"name" = "domain-search";
"data" = config.networking.domain;
}
];
"pools" = [
{
"pool" = "10.32.47.100-10.32.47.200";
}
];
"reservations" = concatLists (mapAttrsToList
(_: node: optional
(node.config.networking.interfaces."data".macAddress != null)
{
"hw-address" = node.config.networking.interfaces."data".macAddress;
"ip-address" = "10.32.47.${toString (100 + node.options._module.args.value.nodeId)}";
})
nodes);
}
];
};
};
};
}