-
Notifications
You must be signed in to change notification settings - Fork 1
feat(B-0855.1): add first-boot self-register service module #5416
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 12 commits into
main
from
claim/codex-b0855-1-zeta-self-register-service-20260527
May 27, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0c6f240
claim: codex-b0855-1-zeta-self-register-service-20260527 - scope B-08…
5bb7f2d
feat: codex-b0855-1-zeta-self-register-service-20260527 - add first-b…
eb6dbad
release: codex-b0855-1-zeta-self-register-service-20260527 - opened i…
6626ccf
fix: codex-b0855-1-zeta-self-register-service-20260527 - derive self-…
d87acce
fix: repair Docker NixOS install-sh harness (#5427)
AceHack e7ac910
fix: align self-register Bun runtime with mise
ed6b5bd
fix: update ISO cosign signing to bundle output
6804c8d
merge: sync PR 5416 with main
354cf04
fix: write cosign bundle to runner temp
a0e4d37
fix: retry self-register until marker exists
6796a42
fix: align ISO signing summary text
ed3c0d2
fix: close self-register review gaps
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
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,100 @@ | ||
| # full-ai-cluster/nixos/modules/zeta-self-register.nix | ||
| # | ||
| # B-0855.1: NixOS service surface for post-install self-registration. | ||
| # The service is intentionally disabled by default until B-0855.2 ships | ||
| # the TypeScript implementation at tools/installer/zeta-self-register.ts. | ||
| # Once enabled by a host config, it fires after the installed OS reaches | ||
| # network-online and credential-restore ordering, then keeps retrying | ||
| # until the local marker confirms registration intent was written. | ||
|
|
||
| { config, lib, ... }: | ||
|
|
||
| let | ||
| cfg = config.zeta.selfRegister; | ||
| bunShimPath = "${cfg.home}/.local/share/mise/shims/bun"; | ||
| in | ||
| { | ||
| options.zeta.selfRegister = { | ||
| enable = lib.mkEnableOption "Zeta post-install first-boot self-registration service"; | ||
|
|
||
| user = lib.mkOption { | ||
| type = lib.types.str; | ||
| default = "zeta"; | ||
| description = "User that runs zeta-self-register.service."; | ||
| }; | ||
|
|
||
| group = lib.mkOption { | ||
| type = lib.types.str; | ||
| default = "users"; | ||
| description = "Primary group for the self-registration service user."; | ||
| }; | ||
|
|
||
| home = lib.mkOption { | ||
| type = lib.types.str; | ||
| default = "/home/zeta"; | ||
| description = "Home directory used for credentials and local marker state."; | ||
| }; | ||
|
|
||
| repoRoot = lib.mkOption { | ||
| type = lib.types.str; | ||
| default = "${cfg.home}/Zeta"; | ||
| description = "Path to the checked-out Zeta repository on the installed node."; | ||
| }; | ||
|
|
||
| scriptPath = lib.mkOption { | ||
| type = lib.types.str; | ||
| default = "${cfg.repoRoot}/tools/installer/zeta-self-register.ts"; | ||
| description = "Bun TypeScript entrypoint for composing self-registration intent."; | ||
| }; | ||
|
|
||
| markerPath = lib.mkOption { | ||
| type = lib.types.str; | ||
| default = "${cfg.home}/.config/zeta/self-registered.marker"; | ||
| description = "Fast-path local marker written after registration intent exists."; | ||
| }; | ||
|
|
||
| intentDir = lib.mkOption { | ||
| type = lib.types.str; | ||
| default = "${cfg.home}/.config/zeta/self-registration-intent"; | ||
| description = "Directory where the service writes registration intent for the local agent steward."; | ||
| }; | ||
| }; | ||
|
|
||
| config = lib.mkIf cfg.enable { | ||
| systemd.services.zeta-self-register = { | ||
| description = "Zeta node self-registration intent writer (B-0855.1)"; | ||
| wantedBy = [ "multi-user.target" ]; | ||
| wants = [ "network-online.target" ]; | ||
| after = [ | ||
| "network-online.target" | ||
| "zeta-creds-restore.service" | ||
| ]; | ||
|
|
||
| unitConfig = { | ||
| ConditionPathExists = [ | ||
| "!${cfg.markerPath}" | ||
| cfg.scriptPath | ||
| bunShimPath | ||
| ]; | ||
| }; | ||
|
|
||
| serviceConfig = { | ||
| Type = "oneshot"; | ||
| User = cfg.user; | ||
| Group = cfg.group; | ||
| WorkingDirectory = cfg.repoRoot; | ||
| Environment = [ | ||
| "HOME=${cfg.home}" | ||
| "PATH=${cfg.home}/.local/share/mise/shims:${cfg.home}/.bun/bin:/run/current-system/sw/bin:/usr/bin:/bin" | ||
| "BUN_INSTALL=${cfg.home}/.bun" | ||
| "ZETA_SELF_REGISTER_MARKER=${cfg.markerPath}" | ||
| "ZETA_SELF_REGISTER_INTENT_DIR=${cfg.intentDir}" | ||
| "ZETA_SELF_REGISTER_REPO=${cfg.repoRoot}" | ||
| ]; | ||
| ExecStart = "${bunShimPath} ${cfg.scriptPath}"; | ||
| Restart = "on-failure"; | ||
| RestartSec = "30s"; | ||
| }; | ||
| }; | ||
| }; | ||
| } | ||
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.