Skip to content

Commit 3f5eace

Browse files
committed
refactor(nix): media, networking, firewall, nginx and nix-client modules
Codecs become technet.media.codecs (Heimdall, Odin and now Thor) and the shader cache a desktop module that keeps NVIDIA's caches only where that driver is loaded. The DDNS name is decrypted only where something renders it. The firewall is a security module; each WireGuard setup trusts its own tunnel, Heimdall alone opens 51820, and Odin's Wi-Fi is no longer trusted. WireGuard splits into networkd and NetworkManager modules. technet.vhosts and nginx-vhosts merge into technet.services.nginx. Attic, nix-index, the GitHub token (now root:wheel) and NixTool become technet.system.nix and apps modules; the aws-lc overlay goes, since nixpkgs builds newsflash and mqttui again.
1 parent 9c0f17f commit 3f5eace

80 files changed

Lines changed: 653 additions & 594 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/certificates.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Every certificate file lives under `secrets/`, public or not.
1616
| A host's key | `https_certificate_key` in `secrets/<folder>/nginx.yaml` |
1717

1818
A host's certificate covers `<host>.technet` and `*.<host>.technet`. nginx finds it through
19-
`technet.vhosts.certificate`, which defaults to the host's own file
20-
([`vhosts.nix`](../nix/0-common/1-system/networking/vhosts.nix)).
19+
`technet.services.nginx.certificate`, which defaults to the host's own file
20+
([`nginx.nix`](../nix/5-modules/services/nginx.nix)).
2121

2222
## A certificate for a new host
2323

‎docs/conventions.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ kind, keep it.
5858
Ragnarok and Odin are on `architecture.x86_64` and `boot.uefi`; Thor and Rock64 have no platform yet and set
5959
`nixpkgs.hostPlatform` themselves.
6060
- [`nix/6-lib`](../nix/6-lib) has `mkHost`, which adds the shared modules (`nix/5-modules`, `nix/3-profiles`,
61-
`nix/4-platforms`, `nix/2-users`, sops, disko, impermanence, Home Manager, nix-index, X-Plymouth) and `specialArgs`, including
61+
`nix/4-platforms`, `nix/2-users`, sops, disko, impermanence, Home Manager, nix-index, X-Plymouth, NixTool) and `specialArgs`, including
6262
`technetHosts`, every folder's identity read by `hostIdentities` without evaluating any system. `mkHosts` builds
6363
every folder in `nix/1-hosts` that has a `default.nix`. A new host needs no `flake.nix` edit, and CI picks it up
6464
from `checks`.
@@ -105,9 +105,9 @@ banners off 150 columns, so check them afterwards.
105105
copy has a v4 UUID, while ensureProfiles derives a v3 one.
106106
- At home, Pi-hole answers `.technet` names with Heimdall's LAN address, so a Heimdall service reached by name
107107
from home needs its port open on the LAN interface as well as `wireguard0`. Test both addresses.
108-
- A web service on Odin or Ragnarok is named `<name>.<host>.technet` by `technet.vhosts.ports`
109-
([`vhosts.nix`](../nix/0-common/1-system/networking/vhosts.nix)): the host's own nginx serves it over HTTPS, and
110-
Pi-hole needs a `cnameRecords` entry pointing the name at `<host>.technet`. Its certificate comes from
108+
- A web service is named `<name>.<host>.technet` by `technet.services.nginx.vhosts`
109+
([`nginx.nix`](../nix/5-modules/services/nginx.nix)): the host's own nginx serves it over HTTPS. On a host other than
110+
Heimdall, the name also goes in that host's `dns.subdomains` so Pi-hole points it at `<host>.technet`. Its certificate comes from
111111
`scripts/new-host-certificate.sh`; see [certificates](certificates.md).
112112

113113
## Secrets
@@ -119,7 +119,7 @@ banners off 150 columns, so check them afterwards.
119119
- `boot.initrd.secrets` values must be string paths; a path literal is copied into the store at eval. They stay out
120120
of the store only while `boot.loader.supportsInitrdSecrets` is true; otherwise NixOS bakes them into the initrd
121121
store path. That is why the WireGuard peer endpoint is a sops-rendered `.netdev.d` drop-in
122-
(`technet.initrdWireguard.peer` in [`initrd-wireguard.nix`](../nix/0-common/1-system/networking/initrd-wireguard.nix)).
122+
(`technet.networking.wireguard.networkd.peer` in [`networkd.nix`](../nix/5-modules/networking/wireguard/networkd.nix)).
123123
- [`secrets/admin/credential-flow.drawio`](../secrets/admin) maps what unlocks what; open it with
124124
[`open-credential-flow.sh`](open-credential-flow.sh).
125125

‎docs/heimdall.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Peers connect *to* Heimdall rather than to each other, so it is the one host
9797
whose reachability everything else depends on. Its initrd WireGuard probe
9898
therefore targets the LAN gateway rather than a peer — a peer may legitimately be
9999
down or still locked, so it is not a usable health signal. See
100-
[`initrd-wireguard.nix`](../nix/0-common/1-system/6-networking/2-initrd-wireguard.nix).
100+
[`networkd.nix`](../nix/5-modules/networking/wireguard/networkd.nix).
101101

102102
DNS for the network is Pi-hole at `10.100.100.1`, backed by Unbound.
103103

@@ -107,7 +107,7 @@ Grouped by directory under [`3-services`](../nix/2-server/3-services):
107107

108108
| Group | Services |
109109
| --- | --- |
110-
| `networking` | nginx, nginx-vhosts, pi-hole, unbound |
110+
| `networking` | nginx, pi-hole, unbound |
111111
| `communication` | mail (dovecot, imapsync, roundcube), matrix (synapse, mautrix bridges) |
112112
| `personal-info-and-files` | blockurl, radicale, syncthing, trilium |
113113
| `fun-and-media` | calibre-web-automated, comet, freshrss, jackett, qbittorrent, stremio, vlc |
@@ -126,7 +126,7 @@ as its own module.
126126
Heimdall runs [Attic](../nix/2-server/3-services/technet/attic.nix) as the
127127
network's binary cache at `https://attic.heimdall.technet/`. Every host
128128
substitutes from the `technet` cache, configured in
129-
[`attic-cache.nix`](../nix/0-common/1-system/software/attic-cache.nix); pushing
129+
[`attic.nix`](../nix/5-modules/system/nix/attic.nix); pushing
130130
into it needs a write token, which is not handed out by default.
131131

132132
Caches and tokens have no declarative provisioning — they are created once by
@@ -141,7 +141,7 @@ atticd-atticadm make-token --sub bootstrap --validity '1h' \
141141
attic login technet https://attic.heimdall.technet/ <token>
142142
attic cache create technet
143143
attic cache configure technet --public
144-
attic cache info technet # prints the public key for attic-cache.nix
144+
attic cache info technet # prints the public key for nix/5-modules/system/nix/attic.nix
145145
```
146146

147147
`--configure-cache-retention` is needed even though nothing here sets a

‎nix/0-common/1-system/default.nix‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
{
44
imports = [
55
./software
6-
./networking
7-
./graphics
86
];
97
}

‎nix/0-common/1-system/graphics/default.nix‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎nix/0-common/1-system/graphics/shader-cache.nix‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎nix/0-common/1-system/networking/default.nix‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎nix/0-common/1-system/networking/firewall.nix‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎nix/0-common/1-system/networking/vhosts.nix‎

Lines changed: 0 additions & 67 deletions
This file was deleted.

‎nix/0-common/1-system/software/attic-cache.nix‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)