mcpField
N
nix-rebuild

nix-rebuild

github.com/edmundmillerCloud & DevOps8046 installsUpdated today
Repository

About nix-rebuild

nix-rebuild is a skill for applying changes to Nix-managed configuration on macOS. It documents a direct darwin-rebuild command and the hey wrapper for rebuilding, testing, and rolling back system generations.

Key features

  1. 01Rebuild configuration with darwin-rebuild
  2. 02Run rebuilds through hey
  3. 03Build and activate without a boot entry
  4. 04Roll back to the previous generation
  5. 05Verify updated Nix store symlinks

Use cases

  1. 01Apply edits to Nix configuration files
  2. 02Activate changes to Home Manager-linked files
  3. 03Recover from an unwanted system generation

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/edmundmiller/dotfiles --skill nix-rebuild

After installing, type/nix-rebuildin Claude Code to confirm it loaded.

Details

From the project README

Nix System Rebuild

After changing any Nix-managed config in ~/.config/dotfiles, the system must be rebuilt for changes to take effect. Nix store symlinks are read-only — you cannot edit them in place.

Quick Rebuild

cd ~/.config/dotfiles
sudo darwin-rebuild switch --flake .

darwin-rebuild has a NOPASSWD sudoers rule, so this works non-interactively.

Using hey

The hey command wraps rebuilds:

hey rebuild    # or: hey re
hey test       # build + activate without boot entry
hey rollback   # roll back to previous generation

When to Rebuild

  • After editing any .nix file
  • After editing config files symlinked through home-manager (lazygit, ghostty, etc.)
  • When you see "permission denied" writing to a Nix store path

Workflow

  1. Edit source config in ~/.config/dotfiles/
  2. Commit changes
  3. Run sudo darwin-rebuild switch --flake ~/.config/dotfiles
  4. Verify the symlink now points to updated Nix store path

Comments

Markdown supported