From 048536ba70f9e32a3474b7a7a1f8a79d15a233fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Tue, 3 Feb 2026 04:51:27 +0100 Subject: [PATCH] docs: move dns automation from TODO.md to nixos-improvements.md --- TODO.md | 30 ------------------------------ docs/plans/nixos-improvements.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 docs/plans/nixos-improvements.md diff --git a/TODO.md b/TODO.md index 77a5068..bf3d136 100644 --- a/TODO.md +++ b/TODO.md @@ -484,36 +484,6 @@ vault01.home.2rjus.net (10.69.13.19) --- -### Phase 5: DNS Automation - -**Goal:** Automatically generate DNS entries from host configurations - -**Approach:** Leverage Nix to generate zone file entries from flake host configurations - -Since most hosts use static IPs defined in their NixOS configurations, we can extract this information and automatically generate A records. This keeps DNS in sync with the actual host configs. - -**Tasks:** -- [ ] Add optional CNAME field to host configurations - - [ ] Add `networking.cnames = [ "alias1" "alias2" ]` or similar option - - [ ] Document in host configuration template -- [ ] Create Nix function to extract DNS records from all hosts - - [ ] Parse each host's `networking.hostName` and IP configuration - - [ ] Collect any defined CNAMEs - - [ ] Generate zone file fragment with A and CNAME records -- [ ] Integrate auto-generated records into zone files - - [ ] Keep manual entries separate (for non-flake hosts/services) - - [ ] Include generated fragment in main zone file - - [ ] Add comments showing which records are auto-generated -- [ ] Update zone file serial number automatically -- [ ] Test zone file validity after generation -- [ ] Either: - - [ ] Automatically trigger DNS server reload (Ansible) - - [ ] Or document manual step: merge to master, run upgrade on ns1/ns2 - -**Deliverable:** DNS A records and CNAMEs automatically generated from host configs - ---- - ### Phase 6: Integration Script **Goal:** Single command to create and deploy a new host diff --git a/docs/plans/nixos-improvements.md b/docs/plans/nixos-improvements.md new file mode 100644 index 0000000..982791c --- /dev/null +++ b/docs/plans/nixos-improvements.md @@ -0,0 +1,31 @@ +# NixOS Infrastructure Improvements + +This document contains planned improvements to the NixOS infrastructure that are not directly part of the automated deployment pipeline. + +## DNS Automation + +**Goal:** Automatically generate DNS entries from host configurations + +**Approach:** Leverage Nix to generate zone file entries from flake host configurations + +Since most hosts use static IPs defined in their NixOS configurations, we can extract this information and automatically generate A records. This keeps DNS in sync with the actual host configs. + +**Tasks:** +- [ ] Add optional CNAME field to host configurations + - [ ] Add `networking.cnames = [ "alias1" "alias2" ]` or similar option + - [ ] Document in host configuration template +- [ ] Create Nix function to extract DNS records from all hosts + - [ ] Parse each host's `networking.hostName` and IP configuration + - [ ] Collect any defined CNAMEs + - [ ] Generate zone file fragment with A and CNAME records +- [ ] Integrate auto-generated records into zone files + - [ ] Keep manual entries separate (for non-flake hosts/services) + - [ ] Include generated fragment in main zone file + - [ ] Add comments showing which records are auto-generated +- [ ] Update zone file serial number automatically +- [ ] Test zone file validity after generation +- [ ] Either: + - [ ] Automatically trigger DNS server reload (Ansible) + - [ ] Or document manual step: merge to master, run upgrade on ns1/ns2 + +**Deliverable:** DNS A records and CNAMEs automatically generated from host configs