Move all four channels and both home-manager inputs to the rebased fork and current channels, and refresh the other moving inputs. Bump the latest kernel to 7.3 and the release metadata to 26.11. Follow upstream removals: pin `colony-psql` (PostgreSQL 14) to `mine-stable` until the PostgreSQL 18 migration that follows, and `spoder` (Nextcloud 32) until its own migration, and take MinIO for `object` from `mine-stable` through a compatibility import. Replace Gitea's removed `DOMAIN` with `SSH_DOMAIN`, let `determinate-nix` pick its own nixpkgs, and drop the nginx bump now that every pin ships fixed releases. Move Frigate's recording retention to the `record.continuous` layout, since 0.18 rejects `record.retain`. Pass the borgbackup wrapper flags as separate arguments now that the package uses structured attributes. Stop `britway`'s mesh link gating `network-online.target`: systemd 262 holds it in configuring until `tailscale0` exists for its policy rule, and tailscaled only starts once the network is online. Keep the SCTP module block: no kernel in use carries the NGINX2Root SCTP fix yet. Record the checks `kelder` missed while out of service on its page. Notable upgrades: - Kernels: 6.18.64 LTS and 7.3.5 latest. - Gitea 1.27.2 -> 28.3.0, with schema migrations. - Home Assistant 2026.8.2 -> 2026.11.2 and Frigate 0.17.2 -> 0.18.3. - Jellyfin 10.11.11 -> 12.4, Radarr 6.1 -> 7.0.3 and Sonarr 4.0.17 -> 5.0.0 (a prerelease), each migrating its database. - HedgeDoc 1.11.1 -> 1.12.0, mautrix-whatsapp 26.08 -> 26.11, Vaultwarden 1.37.1 -> 1.37.5, Seerr 3.3.0 -> 3.5.2. - Headscale 0.29.3 -> 0.29.7, BIRD 2.19.2 -> 2.20.0 and Tuwunel 1.8.3 -> 1.9.4. - nginx 1.30.7 and 1.31.9 from the channels, with the NGINX2Root fixes. - `determinate-nix` 3.22.2 -> 3.24.3, `harmonia` 3.2.0 -> 3.3.0, `deploy-rs` 1.0.0, `copyparty` 1.20.21 -> 1.20.26, and `llm-agents` with Codex 0.170.0 and Claude Code 2.1.330. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
519 lines
13 KiB
Nix
519 lines
13 KiB
Nix
{ lib }:
|
|
let
|
|
inherit (lib) concatStringsSep;
|
|
in
|
|
rec {
|
|
# See https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/ids.nix
|
|
ids = {
|
|
uids = {
|
|
matrix-syncv3 = 400;
|
|
gitea-runner = 401;
|
|
jellyseerr = 402;
|
|
atticd = 403;
|
|
kea = 404;
|
|
keepalived_script = 405;
|
|
photoprism = 406;
|
|
copyparty = 408;
|
|
slop-cannon = 1001;
|
|
};
|
|
gids = {
|
|
matrix-syncv3 = 400;
|
|
gitea-runner = 401;
|
|
jellyseerr = 402;
|
|
atticd = 403;
|
|
kea = 404;
|
|
keepalived_script = 405;
|
|
photoprism = 406;
|
|
adbusers = 407;
|
|
copyparty = 408;
|
|
slop-cannon = 1001;
|
|
};
|
|
};
|
|
|
|
kernel = {
|
|
lts = pkgs: pkgs.linuxKernel.packages.linux_6_18;
|
|
latest = pkgs: pkgs.linuxKernel.packages.linux_7_3;
|
|
};
|
|
|
|
nginx = rec {
|
|
proxyHeaders = ''
|
|
# Setting any proxy_header in a child (e.g. location) will nuke the parents...
|
|
proxy_set_header X-Origin-URI $request_uri;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Host $http_host;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
proxy_set_header X-Forwarded-Server $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Protocol $scheme;
|
|
proxy_set_header X-Scheme $scheme;
|
|
'';
|
|
baseHttpConfig = ''
|
|
# NixOS provides a logrotate config that auto-compresses :)
|
|
log_format main
|
|
'$remote_addr - $remote_user [$time_local] $scheme "$host" "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
# optimisation
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
keepalive_timeout 65;
|
|
|
|
# gzip
|
|
gzip on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 5;
|
|
gzip_types
|
|
application/atom+xml
|
|
application/javascript
|
|
application/json
|
|
application/xml
|
|
application/xml+rss
|
|
image/svg+xml
|
|
text/css
|
|
text/javascript
|
|
text/plain
|
|
text/xml;
|
|
gzip_vary on;
|
|
|
|
# proxying
|
|
proxy_buffering off;
|
|
proxy_redirect off;
|
|
proxy_connect_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_http_version 1.1;
|
|
|
|
${proxyHeaders}
|
|
'';
|
|
};
|
|
|
|
networkd = {
|
|
noL3 = {
|
|
LinkLocalAddressing = "no";
|
|
DHCP = "no";
|
|
LLDP = false;
|
|
EmitLLDP = false;
|
|
IPv6AcceptRA = false;
|
|
};
|
|
};
|
|
|
|
nix = {
|
|
cache = rec {
|
|
substituters = [
|
|
"https://nix-cache.${pubDomain}"
|
|
"https://cache.numtide.com"
|
|
];
|
|
keys = [
|
|
"nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4="
|
|
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
|
|
];
|
|
conf = ''
|
|
extra-substituters = ${concatStringsSep " " substituters}
|
|
extra-trusted-public-keys = ${concatStringsSep " " keys}
|
|
'';
|
|
};
|
|
|
|
# Determinate-specific settings enabling its performance features. Only understood by the
|
|
# Determinate Nix binary, so they must not be emitted for a base-Nix package.
|
|
determinateSettings = {
|
|
lazy-trees = true;
|
|
eval-cores = 0;
|
|
};
|
|
};
|
|
|
|
pubDomain = "nul.ie";
|
|
colony = rec {
|
|
domain = "ams1.int.${pubDomain}";
|
|
pubV4 = "94.142.240.44";
|
|
prefixes = with lib.my.net.cidr; rec {
|
|
all = {
|
|
v4 = "10.100.0.0/16";
|
|
v6 = "2a0e:97c0:4d2:10::/60";
|
|
};
|
|
base = {
|
|
v4 = subnet 8 0 all.v4;
|
|
v6 = subnet 4 0 all.v6;
|
|
};
|
|
vms = {
|
|
v4 = subnet 8 1 all.v4;
|
|
v6 = subnet 4 1 all.v6;
|
|
};
|
|
ctrs = {
|
|
v4 = subnet 8 2 all.v4;
|
|
v6 = subnet 4 2 all.v6;
|
|
};
|
|
oci = {
|
|
v4 = subnet 8 3 all.v4;
|
|
v6 = subnet 4 3 all.v6;
|
|
};
|
|
qclk = {
|
|
v4 = subnet 8 4 all.v4;
|
|
};
|
|
|
|
p2pTunnels = {
|
|
v4 = subnet 8 5 all.v4;
|
|
};
|
|
hillcrest = {
|
|
v4 = subnet 6 0 p2pTunnels.v4;
|
|
};
|
|
john-valorant = {
|
|
v4 = subnet 6 1 p2pTunnels.v4;
|
|
};
|
|
|
|
cust = {
|
|
v4 = subnet 8 100 all.v4; # single ip for routing only
|
|
v6 = "2a0e:97c0:4d2:2000::/56";
|
|
};
|
|
mail = {
|
|
v4 = "94.142.241.227/32";
|
|
v6 = subnet 8 0 cust.v6;
|
|
};
|
|
darts = {
|
|
v4 = "94.142.242.255/32";
|
|
v6 = subnet 8 1 cust.v6;
|
|
};
|
|
jam = {
|
|
v4 = subnet 8 4 cust.v4;
|
|
v6 = subnet 8 2 cust.v6;
|
|
};
|
|
|
|
vip1 = "94.142.241.224/30";
|
|
vip2 = "94.142.242.254/31";
|
|
vip3 = "94.142.241.117/32";
|
|
|
|
as211024 = {
|
|
v4 = subnet 8 50 all.v4;
|
|
v6 = "2a0e:97c0:4df::/64";
|
|
};
|
|
home.v6 = "2a0e:97c0:4d0::/48";
|
|
};
|
|
|
|
custRouting = with lib.my.net.cidr; {
|
|
mail-vm = host 1 prefixes.cust.v4;
|
|
darts-vm = host 2 prefixes.cust.v4;
|
|
jam-ctr = host 3 prefixes.cust.v4;
|
|
};
|
|
|
|
qclk = {
|
|
wgPort = 51821;
|
|
};
|
|
|
|
firewallForwards = aa: [
|
|
{
|
|
port = "http";
|
|
dst = aa.middleman.internal.ipv4.address;
|
|
}
|
|
{
|
|
port = "https";
|
|
dst = aa.middleman.internal.ipv4.address;
|
|
}
|
|
{
|
|
port = 8448;
|
|
dst = aa.middleman.internal.ipv4.address;
|
|
}
|
|
|
|
{
|
|
port = 25565;
|
|
dst = aa.simpcraft-oci.internal.ipv4.address;
|
|
}
|
|
{
|
|
port = 25566;
|
|
dst = aa.simpcraft-staging-oci.internal.ipv4.address;
|
|
}
|
|
{
|
|
port = 25567;
|
|
dst = aa.kevcraft-oci.internal.ipv4.address;
|
|
}
|
|
{
|
|
port = 25568;
|
|
dst = aa.kinkcraft-oci.internal.ipv4.address;
|
|
}
|
|
{
|
|
port = 25569;
|
|
dst = aa.graeme-oci.internal.ipv4.address;
|
|
}
|
|
|
|
# RCON... unsafe?
|
|
# {
|
|
# port = 25575;
|
|
# dst = aa.simpcraft-oci.internal.ipv4.address;
|
|
# }
|
|
|
|
{
|
|
port = 7777;
|
|
dst = aa.gam.internal.ipv4.address;
|
|
}
|
|
|
|
{
|
|
port = 2456;
|
|
dst = aa.valheim-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
{
|
|
port = 2457;
|
|
dst = aa.valheim-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
|
|
{
|
|
port = 41641;
|
|
dst = aa.waffletail.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
|
|
{
|
|
port = 25565;
|
|
dst = aa.simpcraft-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
{
|
|
port = 25567;
|
|
dst = aa.kevcraft-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
{
|
|
port = 25568;
|
|
dst = aa.kinkcraft-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
{
|
|
port = 25569;
|
|
dst = aa.graeme-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
|
|
{
|
|
port = 15636;
|
|
dst = aa.enshrouded-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
{
|
|
port = 15637;
|
|
dst = aa.enshrouded-oci.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
|
|
{
|
|
port = qclk.wgPort;
|
|
dst = aa.qclk.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
|
|
{
|
|
port = 7777;
|
|
dst = aa.gam.internal.ipv4.address;
|
|
proto = "udp";
|
|
}
|
|
];
|
|
|
|
fstrimConfig = {
|
|
enable = true;
|
|
# backup happens at 05:00
|
|
interval = "04:45";
|
|
};
|
|
};
|
|
|
|
home = rec {
|
|
domain = "h.${pubDomain}";
|
|
# Search domains advertised to clients (radvd DNSSL / kea domain-search)
|
|
searchDomains = [ domain "dyn.${domain}" colony.domain britway.domain ];
|
|
vlans = {
|
|
hi = 100;
|
|
lo = 110;
|
|
untrusted = 120;
|
|
wan = 130;
|
|
|
|
# Digiweb delivers the ISP VLAN (pon-isp, 10) single-tagged at the ONT alongside the ONT's
|
|
# own untagged management traffic. With a single ONT we trunk pon-isp (10) straight through
|
|
# the switches to river (PPPoE runs directly on it), and the switch at the ONT edge PVIDs the
|
|
# untagged management port onto wan-pon-ont (140). wan-pon-isp (141) is reserved for the
|
|
# future multi-ONT case, where per-port VLAN translation on a dedicated switch swaps each
|
|
# ONT's VLAN 10 to a distinct fabric VLAN (see docs/sites/home/switches.md).
|
|
pon-isp = 10;
|
|
wan-pon-ont = 140;
|
|
wan-pon-isp = 141;
|
|
};
|
|
hiMTU = 9000;
|
|
routers = [
|
|
"river"
|
|
"stream"
|
|
];
|
|
routersPubV4 = [
|
|
"84.203.124.128" # river: Digiweb static
|
|
"109.255.108.121"
|
|
];
|
|
|
|
prefixes = with lib.my.net.cidr; rec {
|
|
modem = {
|
|
v4 = "192.168.0.0/24";
|
|
};
|
|
ont = {
|
|
v4 = "192.168.100.0/24";
|
|
};
|
|
all = {
|
|
v4 = "192.168.64.0/18";
|
|
v6 = "2a0e:97c0:4d0::/60";
|
|
};
|
|
core = {
|
|
v4 = subnet 6 0 all.v4;
|
|
};
|
|
hi = {
|
|
v4 = subnet 4 1 all.v4;
|
|
v6 = subnet 4 1 all.v6;
|
|
mtu = hiMTU;
|
|
};
|
|
lo = {
|
|
v4 = subnet 3 1 all.v4;
|
|
v6 = subnet 4 2 all.v6;
|
|
mtu = 1500;
|
|
};
|
|
untrusted = {
|
|
v4 = subnet 6 16 all.v4;
|
|
v6 = subnet 4 3 all.v6;
|
|
mtu = 1500;
|
|
};
|
|
inherit (colony.prefixes) as211024;
|
|
};
|
|
vips = with lib.my.net.cidr; {
|
|
hi = {
|
|
v4 = host (4*256-2) prefixes.hi.v4;
|
|
v6 = host 65535 prefixes.hi.v6;
|
|
};
|
|
lo = {
|
|
v4 = host (8*256-2) prefixes.lo.v4;
|
|
v6 = host 65535 prefixes.lo.v6;
|
|
};
|
|
untrusted = {
|
|
v4 = host 254 prefixes.untrusted.v4;
|
|
v6 = host 65535 prefixes.untrusted.v6;
|
|
};
|
|
as211024 = {
|
|
v4 = host 4 prefixes.as211024.v4;
|
|
v6 = host ((1*65536*65536*65536) + 65535) prefixes.as211024.v6;
|
|
};
|
|
};
|
|
|
|
# networkConfig fragment anchoring a VLAN client's DNS on the router pair's
|
|
# VRRP VIPs rather than the RA RDNSS. v6 addresses here are RA/token-derived,
|
|
# so when RA is absent (e.g. v6 disabled) there is no v6 and no RDNSS at all;
|
|
# the always-present static v4 VIP keeps name resolution working, with the v6
|
|
# VIP as a bonus when v6 is up. Merge into the VLAN network's networkConfig.
|
|
vlanDns = vlan: {
|
|
DNS = [ vips.${vlan}.v4 vips.${vlan}.v6 ];
|
|
Domains = searchDomains;
|
|
};
|
|
|
|
roceBootModules = [ "ib_core" "ib_uverbs" "mlx5_core" "mlx5_ib" ];
|
|
};
|
|
|
|
britway = {
|
|
domain = "lon1.int.${pubDomain}";
|
|
pubV4 = "45.76.141.188";
|
|
prefixes = {
|
|
vultr = {
|
|
v6 = "2001:19f0:7402:128b::/64";
|
|
};
|
|
inherit (colony.prefixes) as211024;
|
|
};
|
|
# Need to use this IP as the source address for BGP
|
|
assignedV6 = "2001:19f0:7402:128b:5400:04ff:feac:6e06";
|
|
};
|
|
|
|
britnet = {
|
|
domain = "bhx1.int.${pubDomain}";
|
|
pubV4 = "77.74.199.67";
|
|
vpn = {
|
|
port = 51820;
|
|
};
|
|
prefixes = with lib.my.net.cidr; rec {
|
|
vpn = {
|
|
v4 = "10.200.0.0/24";
|
|
v6 = "fdfb:5ebf:6e84::/64";
|
|
};
|
|
};
|
|
};
|
|
|
|
tailscale = {
|
|
prefix = {
|
|
v4 = "100.64.0.0/10";
|
|
v6 = "fd7a:115c:a1e0::/48";
|
|
};
|
|
};
|
|
|
|
as211024 = rec {
|
|
trusted = {
|
|
v4 = [
|
|
colony.prefixes.as211024.v4
|
|
colony.prefixes.all.v4
|
|
home.prefixes.all.v4
|
|
tailscale.prefix.v4
|
|
];
|
|
v6 = [
|
|
colony.prefixes.as211024.v6
|
|
colony.prefixes.all.v6
|
|
home.prefixes.all.v6
|
|
tailscale.prefix.v6
|
|
];
|
|
};
|
|
nftTrust = ''
|
|
iifname as211024 ip saddr { ${concatStringsSep ", " trusted.v4} } accept
|
|
iifname as211024 ip6 saddr { ${concatStringsSep ", " trusted.v6} } accept
|
|
'';
|
|
};
|
|
|
|
# Non-public destinations, plus our own IPv6 prefixes (trusted across the mesh), for keeping
|
|
# untrusted workloads to the Internet
|
|
internalNets = rec {
|
|
v4 = [
|
|
"0.0.0.0/8" "10.0.0.0/8" "100.64.0.0/10" "127.0.0.0/8" "169.254.0.0/16"
|
|
"172.16.0.0/12" "192.168.0.0/16" "224.0.0.0/4" "240.0.0.0/4"
|
|
];
|
|
v6 = [
|
|
"::/127" "::ffff:0:0/96" "fc00::/7" "fe80::/10" "ff00::/8"
|
|
] ++ map (p: colony.prefixes.${p}.v6) [ "home" "all" "cust" "as211024" ];
|
|
nftReject = ''
|
|
ip daddr { ${concatStringsSep ", " v4} } reject with icmpx admin-prohibited
|
|
ip6 daddr { ${concatStringsSep ", " v6} } reject with icmpx admin-prohibited
|
|
'';
|
|
};
|
|
|
|
kelder = {
|
|
groups = {
|
|
storage = 2000;
|
|
media = 2010;
|
|
};
|
|
|
|
domain = "hentai.engineer";
|
|
ipv4MTU = 1460;
|
|
vpn = {
|
|
port = 51820;
|
|
};
|
|
prefixes = with lib.my.net.cidr; rec {
|
|
all.v4 = "172.16.64.0/20";
|
|
ctrs.v4 = subnet 4 0 all.v4;
|
|
};
|
|
};
|
|
|
|
hillcrest = {
|
|
vpn.port = 51822;
|
|
};
|
|
|
|
john-valorant = {
|
|
vpn.port = 51823;
|
|
};
|
|
|
|
sshKeyFiles = {
|
|
me = ../.keys/me.pub;
|
|
deploy = ../.keys/deploy.pub;
|
|
rsyncNet = ../.keys/zh2855.rsync.net.pub;
|
|
mailcowAcme = ../.keys/mailcow-acme.pub;
|
|
harmonia = ../.keys/harmonia.pub;
|
|
};
|
|
sshHostKeys = {
|
|
mail-vm = ../.keys/mail-vm-host.pub;
|
|
};
|
|
}
|