Skip to content

Add dots.ports module: fleet-wide service port registry#654

Merged
genebean merged 1 commit into
mainfrom
ports-module
May 29, 2026
Merged

Add dots.ports module: fleet-wide service port registry#654
genebean merged 1 commit into
mainfrom
ports-module

Conversation

@genebean

@genebean genebean commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds `shared/nixos/ports.nix` defining the `options.dots.ports` option schema — a fleet-wide registry with `port`, `protocol`, and `openFirewall` per entry. Global ports (ssh, http, https, node-exporter, photon) live here so any host can reference them.
  • Adds `hosts/nixos/nixnuc/ports.nix` with all nixnuc-specific ports. `networking.firewall.allowedTCPPorts` and `allowedUDPPorts` are auto-derived via `lib.pipe` filtering on `openFirewall` — adding a service only requires one entry in this file.
  • Adds `hosts/nixos/hetznix01/ports.nix` with all hetznix01-specific ports (email stack, MQTT/EMQX, Bitcoin/LND, Matrix federation, and internal services).
  • All hardcoded port numbers across both hosts' `default.nix`, service configs, and container files replaced with `config.dots.ports..port` references (using `inherit` where the attribute name is `port`).

Test plan

  • `nix flake check` or `nixos-rebuild dry-activate` on nixnuc passes
  • `nix flake check` or `nixos-rebuild dry-activate` on hetznix01 passes
  • Deploy nixnuc and verify all services start on expected ports
  • Deploy hetznix01 and verify all services start on expected ports
  • Confirm firewall opens exactly the expected ports on each host (`nft list ruleset`)
  • Verify nginx proxies reach their backends

🤖 Generated with Claude Code

@genebean genebean force-pushed the ports-module branch 3 times, most recently from 89a62ec to c850675 Compare May 29, 2026 03:20
…znix01)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@genebean genebean marked this pull request as ready for review May 29, 2026 12:44
@genebean genebean merged commit 859a573 into main May 29, 2026
1 of 2 checks passed
@genebean genebean deleted the ports-module branch May 29, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant