diff --git a/systems/default.nix b/systems/default.nix index 9cc2ec3..4b91d70 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -50,9 +50,7 @@ in # prod hosts (public user) "cookies.eh22.intern" = mkSystem "x86_64-linux" "cookies.eh22.intern"; "jool.eh22.intern" = mkSystem "x86_64-linux" "jool.eh22.intern"; - - # staging temp infra - "sketchy-router.noc.eh22.intern" = mkSystem "x86_64-linux" "sketchy-router.noc.eh22.intern"; + "dhcp.eh22.intern" = mkSystem "x86_64-linux" "dhcp.eh22.intern"; # misc hosts "test.eh22.intern" = mkSystem "x86_64-linux" "test.eh22.intern"; diff --git a/systems/dhcp.eh22.intern/kea.nix b/systems/dhcp.eh22.intern/kea.nix new file mode 100644 index 0000000..85f28b5 --- /dev/null +++ b/systems/dhcp.eh22.intern/kea.nix @@ -0,0 +1,58 @@ +{ config, pkgs, ... }: +{ + services.kea.dhcp4 = { + enable = true; + settings = { + lease-database = { + name = "/var/lib/kea/dhcp4.leases"; + persist = true; + type = "memfile"; + }; + rebind-timer = 2000; + renew-timer = 1000; + valid-lifetime = 4000; + authoritative = true; + option-data = [ + { + name = "domain-name-servers"; + data = "94.45.254.2"; + } + + { + name = "cookie-servers"; + data = "94.45.254.3"; + always-send = true; + } + ]; + + shared-networks = [ + { + # wifi + id = 224; + subnet = "94.45.224.0/20"; + pools = [ { pool = "94.45.224.10 - 94.45.239.254"; } ]; + option-data = [ + { + name = "routers"; + data = "94.45.224.1"; + } + ]; + } + + { + # wired + id = 240; + subnet = "94.45.240.0/21"; + pools = [ { pool = "94.45.240.10 - 94.45.240.254"; } ]; + option-data = [ + { + name = "routers"; + data = "94.45.240.1"; + } + ]; + } + + ]; + }; + }; +} diff --git a/systems/dhcp.eh22.intern/system.nix b/systems/dhcp.eh22.intern/system.nix new file mode 100644 index 0000000..c709835 --- /dev/null +++ b/systems/dhcp.eh22.intern/system.nix @@ -0,0 +1,34 @@ +{ + pkgs, + config, + ... +}: +{ + imports = [ + ./kea.nix + ]; + + networking = { + interfaces = { + net0 = { + ipv4 = { + addresses = [ + { + address = "94.45.240.3"; + prefixLength = 21; + } + ]; + }; + }; + }; + defaultGateway = "94.45.240.1"; + }; + systemd.network.links."10-net0" = { + matchConfig.MACAddress = "BC:24:11:BE:24:52"; + linkConfig.Name = "net0"; + }; + # DO NOT CHANGE + # this defines the first version of NixOS that was installed on the machine so that programs with non-migratable data files are kept compatible + home-manager.users.noc.home.stateVersion = "24.11"; + system.stateVersion = "24.11"; +}