Fix deploy-rs: non-digit node keys + avoid deploy package/output coll… - #34
Merged
Conversation
…ision
Two bugs made every `deploy <host>` fail:
1. `deploy 204` → "Error parsing flake: Unrecognized node or token".
deploy-rs parses the node name as a Nix attr path, and a bare
identifier can't start with a digit — so 201-mono/203-media/204-agent/
205-builder all failed to parse (only observability would have worked).
Fix: key deploy.nodes by the name with any leading "<digits>-" stripped
(201-mono -> mono); the profile still points at nixosConfigurations.
"201-mono". The CLI keeps resolving 201 / 201-mono / mono.
2. Once parsing succeeded, deploy-rs failed decoding the deploy schema
("invalid type: string .../deploy, expected struct Data"): the CLI
package was named `deploy`, colliding with the flake.deploy output, so
`<flake>#deploy` resolved to the wrapper derivation instead of the
schema. Fix: rename the package attr to deploy-cli (binary stays
`deploy`).
Verified without deploying: deploy.nodes keys are now
agent/builder/media/mono/observability, `deploy --list` resolves all
alias forms, and deploy-rs loads the schema and reports a clean
"attribute 'nope' missing" for a nonexistent node.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes deploy <host> failures by ensuring deploy-rs node keys are valid Nix attr-path identifiers (no leading digits) and by renaming the wrapper package output to avoid colliding with flake.deploy.
Changes:
- Strip leading
"<digits>-"from registry hostnames when generatingflake.deploy.nodeskeys (e.g."201-mono"→mono) while keeping profiles targeting the originalnixosConfigurations."201-mono". - Rename the wrapper package from
packages.deploy→packages.deploy-cli(binary stilldeploy) to prevent<flake>#deployfrom resolving to a derivation instead of the deploy-rs schema. - Update the Mac host to install
deploy-cliinstead of the olddeploypackage attribute.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| modules/hosts/mac.nix | Switch systemPackages to install self.packages.<system>.deploy-cli instead of deploy. |
| modules/deploy.nix | Change deploy-rs node keys to non-digit-leading identifiers; rename CLI package output to deploy-cli and update alias resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+18
to
+23
| # 2. perSystem packages.deploy-cli — the CLI (binary name `deploy`). `deploy | ||
| # 201` deploys 201-mono from the current checkout; `deploy 201 somebranch` | ||
| # builds+deploys that git branch; `deploy --all` does every node. Wired onto | ||
| # the Mac in modules/hosts/mac.nix. The package attr is deploy-cli, NOT | ||
| # deploy, so it doesn't collide with the flake.deploy output (deploy-rs | ||
| # evaluates `<flake>#deploy` and must get the schema, not this derivation). |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…ision
Two bugs made every
deploy <host>fail:deploy 204→ "Error parsing flake: Unrecognized node or token". deploy-rs parses the node name as a Nix attr path, and a bare identifier can't start with a digit — so 201-mono/203-media/204-agent/ 205-builder all failed to parse (only observability would have worked). Fix: key deploy.nodes by the name with any leading "-" stripped (201-mono -> mono); the profile still points at nixosConfigurations. "201-mono". The CLI keeps resolving 201 / 201-mono / mono.Once parsing succeeded, deploy-rs failed decoding the deploy schema ("invalid type: string .../deploy, expected struct Data"): the CLI package was named
deploy, colliding with the flake.deploy output, so<flake>#deployresolved to the wrapper derivation instead of the schema. Fix: rename the package attr to deploy-cli (binary staysdeploy).Verified without deploying: deploy.nodes keys are now agent/builder/media/mono/observability,
deploy --listresolves all alias forms, and deploy-rs loads the schema and reports a clean "attribute 'nope' missing" for a nonexistent node.