-
Notifications
You must be signed in to change notification settings - Fork 1
feat(B-0792 iter-5.1+5.2): self-contained USB — NM-profile persist + Avahi mDNS + per-node hostname injection (decouple from role-stack) (Aaron 2026-05-26) #5103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AceHack
merged 3 commits into
main
from
otto-cli/iter51-wifi-creds-injection-mdns-publishing-2026-05-26
May 26, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # full-ai-cluster/nixos/modules/injected-hostname.nix | ||
| # | ||
| # iter-5.2 (B-0792): per-node hostname injection for multi-node clusters. | ||
| # | ||
| # Without this, every USB-installed node uses the flake host config's | ||
| # hardcoded `networking.hostName` (e.g., "control-plane" for every node | ||
| # built from the control-plane flake). Result for multi-node: | ||
| # | ||
| # - All control-plane nodes have hostname "control-plane" | ||
| # - mDNS publishing collides; second + later nodes auto-rename to | ||
| # "control-plane-2.local" / "control-plane-3.local" via Avahi's | ||
| # conflict-resolution but underlying NixOS hostname stays | ||
| # "control-plane" (confusing in logs, journalctl, kubectl, etc.) | ||
| # | ||
| # Fix: zeta-install.sh reads `zeta-hostname.txt` from the USB ESP (if | ||
| # the operator passed `--host <name>` to zflash) + writes the chosen | ||
| # hostname to `/mnt/etc/zeta/cluster-node-id` during install. This | ||
| # module reads that file at NixOS evaluation time + overrides | ||
| # `networking.hostName`. | ||
| # | ||
| # Imported by `common.nix` so EVERY host (control-plane, worker-gpu, | ||
| # worker-template, future configs) gets the override capability | ||
| # automatically. Default behavior preserved: if the file doesn't | ||
| # exist, `networking.hostName` from the per-host config remains in | ||
| # effect (e.g., `control-plane` stays `control-plane` for the | ||
| # zero-typing single-node case). | ||
| # | ||
| # Aaron 2026-05-26: "make any multi node changes we need to like | ||
| # think though mdns names when we have two control planes." | ||
|
|
||
| { config, lib, ... }: | ||
|
|
||
| let | ||
| idFile = "/etc/zeta/cluster-node-id"; | ||
| injectedRaw = | ||
| if builtins.pathExists idFile | ||
| then builtins.readFile idFile | ||
| else null; | ||
| # Strip trailing newline + whitespace; reject empty result. | ||
| injected = | ||
| if injectedRaw == null | ||
| then null | ||
| else | ||
| let | ||
| trimmed = lib.removeSuffix "\n" (lib.removeSuffix " " injectedRaw); | ||
| in | ||
| if trimmed == "" then null else trimmed; | ||
| in | ||
| { | ||
| # mkOverride 50 wins over the per-host config's default | ||
| # (mkDefault = 1000) but loses to explicit operator overrides | ||
| # (mkForce = 50 too; explicit `networking.hostName = "..."` without | ||
| # any priority modifier = 100). The intent: zeta-install.sh's | ||
| # injected value is preferred over the flake's per-host default | ||
| # BUT operators rebuilding with a custom override in a new | ||
| # configuration retain control. | ||
| networking.hostName = lib.mkIf (injected != null) (lib.mkOverride 50 injected); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.