feat(deploy): add rollback and switch-generation just recipes #249
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:electra
host:fleet
host:lyra
host:nova
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!249
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/rollback-and-generation-just-recipes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds two new Just recipes for generation management without rebuilding.
New recipes
just rollbackRolls back to the previous generation without rebooting.
sudo nixos-rebuild --flake .#<host> switch --rollback).igpu/dgpu) if one is active.just switch-generation <N>Switches to an explicit previous generation without rebooting.
/nix/var/nix/profiles/system-<N>-linkexists.switch-to-configuration switchdirectly.Validation
nix flake checkpasses.Automated code review
Reviewed commit:
9dd9c91e54b695f2078945ea92924e59abcd7bc9Verdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
The PR adds two Just recipes,
rollbackandswitch-generation, to manage NixOS system generations. Therollbackrecipe correctly handles Electra specialisations by reading/etc/nixos-specialisationand passing the appropriate flag tonixos-rebuild. Theswitch-generationrecipe manually manipulates the system profile and activates a specific generation, including validation for the existence of the target generation link and the specialisation binary. The implementation is robust, handling edge cases like missing specialisation files by defaulting to base.Blocking findings
None.
Important findings
None.
Suggestions
None.
Tests and validation
Questions
nixos-rebuild switch --rollbackautomatically handle the specialisation flag in the same way as the manual implementation, or is the explicit handling necessary for all NixOS versions supported by this flake?Review limitations
just rollbackorjust switch-generationto verify their behavior on a live system./etc/nixos-specialisationor its contents on the target hosts.nixos-rebuildandswitch-to-configurationcommands behave as documented.Diff coverage
justfiles/deploy.just: reviewed — included in a context-limited batchReview metadata
37910ccba9de36680fe2de36680fe20164ec7f290164ec7f299dd9c91e54