Skip to content

Fix deploy-rs: non-digit node keys + avoid deploy package/output coll… - #34

Merged
phonkd merged 1 commit into
mainfrom
adjust-skills-deploy
Jul 17, 2026
Merged

Fix deploy-rs: non-digit node keys + avoid deploy package/output coll…#34
phonkd merged 1 commit into
mainfrom
adjust-skills-deploy

Conversation

@phonkd

@phonkd phonkd commented Jul 17, 2026

Copy link
Copy Markdown
Owner

…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 "-" 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.

…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>
Copilot AI review requested due to automatic review settings July 17, 2026 18:05
@phonkd
phonkd merged commit 35fd43d into main Jul 17, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 generating flake.deploy.nodes keys (e.g. "201-mono"mono) while keeping profiles targeting the original nixosConfigurations."201-mono".
  • Rename the wrapper package from packages.deploypackages.deploy-cli (binary still deploy) to prevent <flake>#deploy from resolving to a derivation instead of the deploy-rs schema.
  • Update the Mac host to install deploy-cli instead of the old deploy package 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 thread modules/deploy.nix
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).
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.

2 participants