upgrade-flake

Update flake.lock inputs and verify NixOS configurations before switching.

37|1|Updated Sep 27, 2025
One-click install
npx skills add https://github.com/richardgill/nix --skill upgrade-flake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: upgrade-flake
Source: https://github.com/richardgill/nix/tree/main/.claude/skills/upgrade-flake
Command: npx skills add https://github.com/richardgill/nix --skill upgrade-flake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill updates flake.lock to pull the latest commits for flake inputs (nixpkgs, home-manager, nix-darwin, stylix) while preserving the current NixOS release channel. It enables newer packages with safe rollback.

Core Features & Use Cases

  • Lockfile refresh: Run nix flake update to fetch latest inputs.
  • Safe verification: Build and verify configurations before applying.
  • Use Case: Regularly refresh package versions without moving to a new NixOS release.

Quick Start

just update; then just check to validate, and finally just switch to apply the upgrade.

Frequently Asked Questions about upgrade-flake

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update flake.lock to the latest nixpkgs without changing my NixOS release channel?

Update flake.lock by running nix flake update to fetch the latest commits for all inputs while preserving your current release channel. This refreshes dependencies like nixpkgs, home-manager, and nix-darwin without forcing a channel migration, enabling newer packages within your chosen release.

What's the safe way to apply flake.lock updates to my NixOS configuration?

Run nix flake update to refresh inputs, then just check to perform a dry-run build and verify the configuration before applying. Use just switch to activate changes, and roll back with nixos-rebuild switch --rollback and git checkout flake.lock if issues occur.

Can I test flake.lock updates before committing them to my system?

Yes. After running nix flake update, use just check to validate the updated configuration in a dry-run build. This lets you verify services and package versions work correctly before applying changes with just switch or committing to version control.

How do I roll back if a flake.lock update breaks my NixOS system?

Rollback using nixos-rebuild switch --rollback to revert to the previous system generation, then git checkout flake.lock to restore the prior lockfile state. This restores both your configuration and dependency versions to the last known working state.

Does this work with nix-darwin and home-manager alongside nixpkgs?

Yes. This Skill updates flake.lock for all inputs including nix-darwin and home-manager while preserving the nixpkgs release channel. It maintains consistent versions across your entire flake-based NixOS or nix-darwin setup.