This commit is contained in:
parent
9f671ce273
commit
e7c87670bc
1 changed files with 1 additions and 22 deletions
|
@ -1,11 +1,6 @@
|
||||||
{ config, pkgs, flat_hosts, ... }:
|
{ config, pkgs, flat_hosts, ... }:
|
||||||
let
|
let
|
||||||
inherit (builtins) filter hasAttr;
|
inherit (builtins) filter hasAttr;
|
||||||
hostToDhcp = { hostname, mac, ip, ... }: {
|
|
||||||
ethernetAddress = mac;
|
|
||||||
hostName = hostname;
|
|
||||||
ipAddress = ip;
|
|
||||||
};
|
|
||||||
hostToKea = {hostname, mac, ip, ...}: {
|
hostToKea = {hostname, mac, ip, ...}: {
|
||||||
inherit hostname;
|
inherit hostname;
|
||||||
hw-address = mac;
|
hw-address = mac;
|
||||||
|
@ -41,25 +36,9 @@ in {
|
||||||
|
|
||||||
networking.firewall.allowedUDPPorts = [ 67 ];
|
networking.firewall.allowedUDPPorts = [ 67 ];
|
||||||
|
|
||||||
services.dhcpd4 = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
option subnet-mask 255.255.254.0;
|
|
||||||
option broadcast-address 10.42.43.255;
|
|
||||||
option routers 10.42.42.1;
|
|
||||||
option domain-name-servers 10.42.42.15, 10.42.42.16;
|
|
||||||
option domain-name "${localDomain}";
|
|
||||||
option domain-search "${localDomain}";
|
|
||||||
subnet 10.42.42.0 netmask 255.255.254.0 {
|
|
||||||
range 10.42.43.1 10.42.43.254;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
machines = map hostToDhcp hosts;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.kea = {
|
services.kea = {
|
||||||
dhcp4 = {
|
dhcp4 = {
|
||||||
enable = false;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
authoritative = true;
|
authoritative = true;
|
||||||
valid-lifetime = 4000;
|
valid-lifetime = 4000;
|
||||||
|
|
Loading…
Reference in a new issue