upgrade-flake
Update flake.lock to get latest packages within the current NixOS release - runs nix flake update, checks build, and optionally applies
When & Why to Use This Skill
The upgrade-flake skill automates the maintenance of NixOS systems by updating the flake.lock file to the latest package versions. It provides a reliable, multi-step workflow—including updating inputs, verifying builds, and applying changes—ensuring that NixOS environments remain up-to-date and stable without manual intervention or risk of breaking the system.
Use Cases
- Routine System Maintenance: Automatically fetch the latest security patches and software updates for NixOS packages within the current release channel.
- Pre-deployment Build Verification: Use the 'check' functionality to validate that new dependency versions are compatible with the existing configuration before applying them.
- Safe Infrastructure Updates: Streamline the 'nix flake update' process with built-in rollback instructions, allowing for quick recovery if an update causes issues.
- Dependency Auditing: Facilitate clear visibility into system changes by generating diffs of the flake.lock file before finalizing updates.
| name | upgrade-flake |
|---|---|
| description | | |
| Triggers | "update flake", "upgrade flake", "nix flake update", "bump flake.lock", |
Upgrade Flake Inputs
Update flake.lock to pull in the latest commits from all flake inputs. This gets you newer package versions without changing NixOS release channels.
What this does
- Updates all inputs to their latest commits (nixpkgs, home-manager, etc.)
- Does NOT change release channels (stays on same NixOS version)
- Safe operation - can always rollback
Process
Update the lock file
just updateThis runs
nix flake updateand updatesflake.lock.Build and verify (safe dry-run)
just checkBuilds all configurations without applying. If this fails, fix errors before proceeding.
Apply the update (when ready)
just switchVerify services are running
systemctl status docker tailscaled
Rollback if needed
When you're done echo out the instructions to:
# Revert to previous system generation
sudo nixos-rebuild switch --rollback
# Revert flake.lock to previous state
git checkout flake.lock
Tips
- show the user what ch
git diff flake.lockto see what changed before applying - Old boot entries remain available for rollback until garbage collected
$ARGUMENTS