4.5 KiB
4.5 KiB
Reference Map
Module Directories
- apps →
modules/apps/(desktop/workstation apps, auto-imported) - dev →
modules/dev/(language toolchains and dev shells, auto-imported) - scripts →
modules/scripts/(script units built viamkscript, auto-imported) - servers →
modules/servers/(reverse-proxied services built viamkserver) - services →
modules/services/(supporting services like syncthing, wireguard) - shell →
modules/shell/(shell customizations and CLI tooling) - network →
modules/network/(networking rules, firewall helpers) - users →
modules/users/(user-related options) - nix →
modules/nix/(Nix configuration and helpers) - patches →
patches/(patch artifacts referenced by modules) - factories →
modules/factories/(mkserver.nix,mkscript.nixshared helpers)
Auto-Import Rules
- Source:
modules/modules.nixusesinputs.self.lib.autoImportto load.nixfiles from module directories. - Filter: Excludes
librewolf.nix; all other.nixfiles in target dirs are loaded automatically. - Implication: Place new modules in the correct category directory with a
.nixfilename; no manual import wiring required unless adding a new factory.
Hosts and Roles
- Configs:
hosts/<name>/configuration.nixwith toggles inhosts/<name>/toggles.nix. - Active hosts:
workstation,server,miniserver,galaxy,emacs. - Roles:
- workstation: developer desktop; provides build power for distributed builds.
- server: primary services host (overrides
my.mainServer = "server"and enables proxies/containers). - miniserver: small-footprint server; default
mainServerin shared options. - galaxy: small server variant using nixpkgs-small.
- emacs: VM profile,
my.secureHost = falsefor secret-free usage.
- Network maps:
my.ipsandmy.interfacesdeclared inmodules/modules.nix; host toggles may override.
Proxy, Firewall, and Networking
- Proxy enablement:
my.enableProxytoggles Nginx reverse proxy; assertions require at least onemy.servers.*.enableProxywhen enabled. - Proxy helpers: use
parts/core.nixhelpers (proxy,proxyReverse,proxyReverseFixfor header preservation,proxyReversePrivatefor mutual TLS).mkserversupplieshost,ip,url, andenableProxydefaults per service. - Main server selection:
my.mainServerchooses where services live by default;mkserversetsisLocalbased on this and picks IPs frommy.ips. - Firewall generation:
inputs.self.lib.generateFirewallPortscombines static ports, additional ports, and service ports frommy.servers(excluding native firewall services). Usemy.network.firewallsettings andgetServicesWithNativeFirewallto derive open ports.
Secrets Map
- Files and purposes:
secrets/certs.yaml→ certificates and TLS material.secrets/env.yaml→ environment variables for services (e.g., lidarr-mb-gap).secrets/gallery.yaml→ media/gallery credentials.secrets/homepage.yaml→ homepage widget secrets.secrets/keys.yaml→ SSH/private keys and key ownership.secrets/wireguard.yaml→ WireGuard peers and private keys.secrets/secrets.yaml→ default SOPS file (general secrets, fallback when unspecified).secrets/ssh/→ host SSH keys and related artifacts.
- secureHost: Only hosts with
my.secureHost = trueconsume SOPS entries and WireGuard interfaces. Keep secret references behindlib.mkIf config.my.secureHost.
Stylix and Theming
- Stylix module:
config/stylix.nixand stylix inputs inflake.nixapply theming. Host togglemy.stylix.enablecontrols activation (see host toggles). - Schemes and assets: Imported via Stylix inputs; wallpapers/fonts sourced from external flakes (
wallpapers,fonts).
Playbooks and Templates
- Playbook template:
docs/playbooks/template.md - Workflows:
docs/playbooks/add-module.md,add-server.md,add-script.md,add-host-toggle.md,add-secret.md - Constitution link-back:
docs/constitution.mdsections on terminology, proxies, secrets, and maintenance.
Quick Audit Checklist
- Module coverage: All categories (apps, dev, scripts, servers, services, shell, network, users, nix, patches) have corresponding entries and auto-import rules.
- Host coverage: Active hosts listed with roles and secureHost status;
mainServernoted. - Proxy rules:
enableProxyusage, proxy helper selection, andmy.ipsmappings documented. - Secrets map: Every secrets file and secureHost gating captured; new secret types aligned to file purposes.
- Discoverability: Paths reachable within two clicks from
docs/constitution.md.