feat: package local NixOS deployment command #125

Merged
nimmo merged 1 commit from feat/nixos-deploy-command into main 2026-07-31 18:45:24 +01:00
Owner

Implements Issue #110 by extracting the local deployment workflow into a reusable nixos-deploy flake package while keeping just deploy as a compatibility wrapper. Preserves host and specialisation selection, NVD comparison, sudo keepalive, activation, cleanup, and remote delegation. Adds mocked regression coverage and README documentation. Refs #110. Validation: nix build .#nixos-deploy --no-link; nix run .#nixos-deploy -- --help; ShellCheck; tests/nixos-deploy-regressions.sh; nix flake check.

Implements Issue #110 by extracting the local deployment workflow into a reusable nixos-deploy flake package while keeping just deploy as a compatibility wrapper. Preserves host and specialisation selection, NVD comparison, sudo keepalive, activation, cleanup, and remote delegation. Adds mocked regression coverage and README documentation. Refs #110. Validation: nix build .#nixos-deploy --no-link; nix run .#nixos-deploy -- --help; ShellCheck; tests/nixos-deploy-regressions.sh; nix flake check.
feat: package local NixOS deployment command
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 45s
Build and Push Attic Cache / build (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 5m22s
c822063c49
Author
Owner

Automated code review

Reviewed commit: c822063c49af7f2b34eff00a259232a603ce491c

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

Extracts local deployment logic into a reusable nixos-deploy flake package, refactors just deploy to delegate to it, and adds regression tests. The extraction preserves all original functionality while improving testability via environment variable overrides. Two actionable findings remain regarding argument expansion and hardcoded paths in the delegation block.

Blocking findings

None.

Important findings

None.

Suggestions

  • Array expansion syntax joins arguments with spaces (scripts/nixos-deploy.sh:69; high confidence)
    "cd /home/nimmo/nixos-config && nix run .#nixos-deploy -- ${remote_args[]}"
    Impact: Arguments containing spaces will be concatenated into a single word when passed over SSH, potentially breaking the remote command.
    Suggested fix: Change ${remote_args[
    ]} to ${remote_args[@]} to preserve each argument as a separate word.

Tests and validation

  • No configured deterministic checks.

Questions

  • Should the hardcoded /home/nimmo/nixos-config path for remote delegation be parameterized to support non-standard checkout locations?

Review limitations

  • Review is based on provided diff and documentation; runtime behavior depends on host environment (e.g., SSH configuration, Nix flake availability).
  • nix flake check validation was not executed locally as per constraints.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • justfiles/deploy.just: reviewed — included in a context-limited batch
  • packages/nixos-deploy/default.nix: reviewed — included in a context-limited batch
  • scripts/nixos-deploy.sh: reviewed — included in a context-limited batch
  • tests/nixos-deploy-regressions.sh: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: qwen3.6:35b-a3b-q8_0
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md
  • Commits considered: 1
  • Previous automated review: none found
  • Findings: 1
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `c822063c49af7f2b34eff00a259232a603ce491c` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment Extracts local deployment logic into a reusable nixos-deploy flake package, refactors just deploy to delegate to it, and adds regression tests. The extraction preserves all original functionality while improving testability via environment variable overrides. Two actionable findings remain regarding argument expansion and hardcoded paths in the delegation block. ### Blocking findings None. ### Important findings None. ### Suggestions - **Array expansion syntax joins arguments with spaces** (scripts/nixos-deploy.sh:69; high confidence) "cd /home/nimmo/nixos-config && nix run .#nixos-deploy -- ${remote_args[*]}" Impact: Arguments containing spaces will be concatenated into a single word when passed over SSH, potentially breaking the remote command. Suggested fix: Change ${remote_args[*]} to ${remote_args[@]} to preserve each argument as a separate word. ### Tests and validation - No configured deterministic checks. ### Questions - Should the hardcoded /home/nimmo/nixos-config path for remote delegation be parameterized to support non-standard checkout locations? ### Review limitations - Review is based on provided diff and documentation; runtime behavior depends on host environment (e.g., SSH configuration, Nix flake availability). - nix flake check validation was not executed locally as per constraints. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `justfiles/deploy.just`: **reviewed** — included in a context-limited batch - `packages/nixos-deploy/default.nix`: **reviewed** — included in a context-limited batch - `scripts/nixos-deploy.sh`: **reviewed** — included in a context-limited batch - `tests/nixos-deploy-regressions.sh`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: qwen3.6:35b-a3b-q8_0 - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md - Commits considered: 1 - Previous automated review: none found - Findings: 1 </details>
nimmo merged commit 67bc6c570f into main 2026-07-31 18:45:24 +01:00
nimmo deleted branch feat/nixos-deploy-command 2026-07-31 18:45:24 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config!125
No description provided.