chore: upgrade from dnsmasq to bind

This commit is contained in:
Greg Hellings
2026-04-19 01:04:41 -05:00
parent fb4c6966af
commit 8509fff746
7 changed files with 75 additions and 19 deletions
+3 -1
View File
@@ -65,6 +65,7 @@
};
}
);
lib' = import ./lib { inherit (top.nixunstable) lib; };
in
top.flake-parts.lib.mkFlake { inputs = top; } {
inherit systems;
@@ -76,6 +77,7 @@
nixpkgs = imported_packages.x86_64-linux;
specialArgs = {
inherit
lib'
metadata
self
top
@@ -112,7 +114,7 @@
nixosConfigurations = (
import ./hosts {
inherit top metadata;
inherit top metadata lib';
nixpkgs = imported_packages;
}
);
+2 -1
View File
@@ -1,5 +1,6 @@
{
top,
lib',
metadata,
nixpkgs,
}:
@@ -18,7 +19,7 @@ let
channel.lib.nixosSystem {
pkgs = nixpkgs.${system};
specialArgs = {
inherit metadata top;
inherit metadata top lib';
};
modules = [
{
+38 -12
View File
@@ -1,7 +1,9 @@
{
config,
pkgs,
lib,
lib',
metadata,
pkgs,
...
}:
let
@@ -9,7 +11,6 @@ let
lanIP = metadata.hosts.${config.networking.hostName}.ip;
iot = "enp2s0";
iotIP = "192.168.66.250";
#routerIP = metadata.infra.gw;
extraHosts = builtins.readFile ./net/hosts;
proxyPort = 3128;
@@ -84,17 +85,42 @@ in
#########
# dnsmasq config
########
dnsmasq = {
bind = {
enable = true;
settings = {
domain = "thehellings.lan";
expand-hosts = true;
log-queries = true;
no-hosts = true; # Do not read /etc/hosts, which makes genesis resolve to 127.0.0.2
addn-hosts = "/etc/adblock_hosts";
hostsdir = "/etc/hosts.d/";
server = dnsServers;
};
cacheNetworks = [
metadata.infra.lan
metadata.infra.tailscale
metadata.infra.nebula
];
zones =
let
makeZoneFile =
hosts: domain:
let
preamble = [
"$ORIGIN\t${domain}."
"$TTL\t1h"
"@\tIN\tSOA\t${config.networking.hostName}\tgreg@thehellings.com (1 1m 1m 1m 1m)"
"\tIN\tNS\t${config.networking.hostName}"
];
makeHost = host: "${host.name}\tIN\tA\t${host.address}";
in
pkgs.writeText "${domain}" (
builtins.concatStringsSep "\n" (preamble ++ (lib.map makeHost hosts) ++ [ "" ])
);
in
lib.mapAttrs
(domain: net: {
master = true;
file = makeZoneFile (lib'.hostsByNet net metadata.hosts) domain;
})
{
"shire-zebra.ts.net" = "tailscale";
"nebula.thehellings.com" = "nebula";
nebula = "nebula";
"thehellings.lan" = "lan";
lan = "lan";
};
};
prometheus.exporters = {
+24
View File
@@ -0,0 +1,24 @@
{ lib, ... }:
{
hostsByNet =
net: hosts:
let
netAttr =
{
lan = "ip";
nebula = "nebulaIp";
tailscale = "ts";
}
.${net};
in
lib.mapAttrsToList
(name: value: {
inherit name;
address = builtins.getAttr netAttr value;
})
(
lib.filterAttrs (
_host: settings: (builtins.hasAttr netAttr settings) && (builtins.getAttr netAttr settings) != null
) hosts
);
}
+3 -3
View File
@@ -20,14 +20,14 @@ metadata:
spec:
interval: 10m
dependsOn:
- name: tailscale-operator
- name: tailscale
namespace: tailscale
- name: kyverno
namespace: kyverno
namespace: kyverno-system
chart:
spec:
chart: longhorn
version: "1.10.2"
version: "1.11.1"
sourceRef:
kind: HelmRepository
name: longhorn
+1 -1
View File
@@ -32,7 +32,7 @@ spec:
containers:
main:
image:
tag: v2.4.1
tag: v2.7.5
env:
DB_HOSTNAME: immich-rw.db.svc.cluster.local
DB_DATABASE_NAME: immich
+4 -1
View File
@@ -2,8 +2,11 @@
"infra": {
"dns": "10.42.1.5",
"gw": "10.42.1.1",
"lan": "10.42.0.0/16",
"netmask": "255.255.0.0",
"prefix": "16"
"nebula": "10.157.0.0/16",
"prefix": "16",
"tailscale": "100.64.0.0/10"
},
"hosts": {
"chronicles": {