summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-09-15 15:36:39 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-09-15 15:36:39 -0500
commitdd0626ac55fd1f6e91227e2fce15d9eb66d00bb8 (patch)
tree4d0fb9cc6832a7c4540bab83d61ec74fdaf8ce57 /hosts
parent2fc24b2307ad8f176c4749190a4f6f73da81cfb5 (diff)
downloadnixos-dd0626ac55fd1f6e91227e2fce15d9eb66d00bb8.tar.xz
nixos-dd0626ac55fd1f6e91227e2fce15d9eb66d00bb8.zip
add dns+dhcp config for poweredge-pro
Diffstat (limited to 'hosts')
-rw-r--r--hosts/poweredge-pro/dns-overrides.nix32
-rw-r--r--hosts/poweredge-pro/dns.nix56
2 files changed, 88 insertions, 0 deletions
diff --git a/hosts/poweredge-pro/dns-overrides.nix b/hosts/poweredge-pro/dns-overrides.nix
new file mode 100644
index 0000000..3bcdb90
--- /dev/null
+++ b/hosts/poweredge-pro/dns-overrides.nix
@@ -0,0 +1,32 @@
+let
+ localResolution.localDomain = "pls.lan";
+ dhcp = {
+ inherit staticLeases;
+ defaultGateway = "192.168.77.1";
+ localhostIp = "192.168.77.2";
+ rangeStart = "192.168.77.50";
+ rangeEnd = "192.168.77.250";
+ };
+ staticLeases = {
+ devel = { macAddress = "00:a0:98:79:81:5a"; staticIp = "192.168.77.3"; };
+ mailcow = { macAddress = "00:a0:98:79:20:a2"; staticIp = "192.168.77.7"; };
+ tjkeller = { macAddress = "00:a0:98:62:cf:86"; staticIp = "192.168.77.8"; };
+ filebrowser = { macAddress = "02:00:00:00:77:12"; staticIp = "192.168.77.12"; };
+ WIN-BGBGC27B1PF = { macAddress = "d8:9e:f3:1c:f0:1c"; staticIp = "192.168.77.30"; }; # DACS
+ DESKTOP-CQ4UIF9 = { macAddress = "08:bf:b8:3f:bd:48"; staticIp = "192.168.77.31"; }; # Kyle
+ WIN-6FVMAFOID4G = { macAddress = "00:a0:98:58:10:85"; staticIp = "192.168.77.33"; }; # QB
+ office-precision = { macAddress = "48:4d:7e:f8:96:47"; staticIp = "192.168.77.34"; };
+ XRX9C934E85D0A3 = { macAddress = "9c:93:4e:85:d0:a3"; staticIp = "192.168.77.40"; }; # Xerox
+ nvr = { macAddress = "98:8b:0a:cf:4f:5e"; staticIp = "192.168.77.176"; };
+ };
+ dns.hostOverrides = {
+ "docs.chexx.net" = "192.168.77.3";
+ "files.chexx.net" = "192.168.77.12";
+ "vault.chexx.net" = "192.168.77.3";
+ "wg-easy.chexx.net" = "192.168.77.3";
+ };
+in {
+ services._router.dnsDhcpConfig = {
+ inherit localResolution dhcp dns;
+ };
+}
diff --git a/hosts/poweredge-pro/dns.nix b/hosts/poweredge-pro/dns.nix
new file mode 100644
index 0000000..fb22afb
--- /dev/null
+++ b/hosts/poweredge-pro/dns.nix
@@ -0,0 +1,56 @@
+{ pkgs, config, ... }: {
+ networking.nameservers = [ "192.168.77.2" ];
+
+ # Router container
+ containers.dnsdhcp = {
+ autoStart = true;
+ ephemeral = true;
+ privateNetwork = true;
+ hostBridge = "br-lan1";
+ #hostBridge = "br-lan1";
+ #localMacAddress = "02:00:00:00:77:01";
+
+ config = { lib, config, ... }: {
+ imports = [
+ ../../nixos/services/router
+ #./router-hosts.nix # Contains dhcp config + static leases + overrides
+ ./dns-overrides.nix
+ ];
+
+ # Network
+ networking = {
+ enableIPv6 = false;
+ defaultGateway = "192.168.77.1";
+ interfaces.eth0.ipv4.addresses = [{
+ address = "192.168.77.2";
+ prefixLength = 24;
+ }];
+ firewall = {
+ # DNS+DHCP ports
+ allowedTCPPorts = [ 53 ];
+ allowedUDPPorts = [ 53 67 ];
+ };
+ };
+
+ # Setup dns server
+ services._router = {
+ dnsDhcpConfig = {
+ enable = true;
+ #localResolution = {
+ # localDomain = "pls.lan";
+ # localDnsAddress = "192.168.77.1@53";
+ # localReverseZone = "77.168.192.in-addr.arpa";
+ #};
+ };
+ routing.enable = false;
+ };
+
+ services.unbound._blocklists = {
+ enable = true;
+ hageziBlocklists = [ "pro" "nsfw" ];
+ };
+
+ system.stateVersion = "26.05";
+ };
+ };
+}