upgrade-flake

Update flake.lock to get latest packages within the current NixOS release - runs nix flake update, checks build, and optionally applies

⭐5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026⬇️2downloads

When & Why to Use This Skill

This Claude skill automates the maintenance of NixOS systems by managing the flake.lock update lifecycle. It streamlines the process of fetching the latest package versions, performing dry-run builds to verify system integrity, and applying updates safely. By providing clear rollback instructions and verification steps, it ensures a reliable and reproducible DevOps workflow for NixOS users.

Use Cases

  • Routine System Maintenance: Automatically update all NixOS flake inputs to stay current with the latest security patches and software versions within a specific release channel.
  • Pre-deployment Verification: Use the 'check' functionality to perform a dry-run build of the system configuration, identifying potential build failures before any changes are applied to the live environment.
  • Safe Rollback Management: Quickly revert system changes and flake.lock states in the event of an unstable update, ensuring high system availability and minimal downtime.
  • Development Environment Syncing: Help developers keep their Nix-based development environments synchronized with the latest upstream package commits across a team.
nameupgrade-flake
descriptionUpdate flake.lock to get latest packages within the current NixOS release - runs nix flake update, checks build, and optionally applies

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

  1. Update the lock file

    just update
    

    This runs nix flake update and updates flake.lock.

  2. Build and verify (safe dry-run)

    just check
    

    Builds all configurations without applying. If this fails, fix errors before proceeding.

  3. Apply the update (when ready)

    just switch
    
  4. Verify 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.lock to see what changed before applying
  • Old boot entries remain available for rollback until garbage collected

$ARGUMENTS