prep nginx migration

This commit is contained in:
Vivian 2023-04-29 19:48:00 +02:00
parent e7c87670bc
commit 24a16976a7
5 changed files with 150 additions and 71 deletions

View file

@ -1,7 +1,7 @@
{ config, pkgs, flat_hosts, ... }:
let
inherit (builtins) filter hasAttr;
hostToKea = {hostname, mac, ip, ...}: {
hostToKea = { hostname, mac, ip, ... }: {
inherit hostname;
hw-address = mac;
ip-address = ip;
@ -31,64 +31,59 @@ in {
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [ ];
networking.firewall.allowedUDPPorts = [ 67 ];
services.kea = {
dhcp4 = {
enable = true;
settings = {
authoritative = true;
valid-lifetime = 4000;
rebind-timer = 2000;
renew-timer = 1000;
services.kea.dhcp4 = {
enable = true;
settings = {
authoritative = true;
valid-lifetime = 4000;
rebind-timer = 2000;
renew-timer = 1000;
interfaces-config.interfaces = [ "eth0" ];
interfaces-config.interfaces = [ "eth0" ];
lease-database = {
name = "/var/lib/kea/dhcp4.leases";
persist = true;
type = "memfile";
};
option-data = [
{
name = "subnet-mask";
data = "255.255.254.0";
}
{
name = "broadcast-address";
data = "10.42.43.255";
}
{
name = "routers";
data = "10.42.42.1";
}
{
name = "domain-name-servers";
data = "10.42.42.15, 10.42.42.16";
}
{
name = "domain-name";
data = "${localDomain}";
}
{
name = "domain-search";
data = "${localDomain}";
}
];
host-reservation-identifiers = [ "hw-address" ];
subnet4 = [{
id = 1;
pools = [{ pool = "10.42.43.1 - 10.42.43.254"; }];
subnet = "10.42.42.0/23";
reservations = map hostToKea hosts;
}];
lease-database = {
name = "/var/lib/kea/dhcp4.leases";
persist = true;
type = "memfile";
};
option-data = [
{
name = "subnet-mask";
data = "255.255.254.0";
}
{
name = "broadcast-address";
data = "10.42.43.255";
}
{
name = "routers";
data = "10.42.42.1";
}
{
name = "domain-name-servers";
data = "10.42.42.15, 10.42.42.16";
}
{
name = "domain-name";
data = localDomain;
}
{
name = "domain-search";
data = localDomain;
}
];
host-reservation-identifiers = [ "hw-address" ];
subnet4 = [{
id = 1;
pools = [{ pool = "10.42.43.1 - 10.42.43.254"; }];
subnet = "10.42.42.0/23";
reservations = map hostToKea hosts;
}];
};
};
}