Rebuilding the Devbox

Rebuild NixOS devbox systems and apply user configuration changes.

4|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/johnnymo87/workstation --skill rebuilding-the-devbox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Rebuilding the Devbox
Source: https://github.com/johnnymo87/workstation/tree/main/.claude/skills/rebuilding-devbox
Command: npx skills add https://github.com/johnnymo87/workstation --skill rebuilding-the-devbox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines maintaining and recovering a NixOS devbox by applying configuration changes and performing full rebuilds when necessary.

Core Features & Use Cases

  • Apply system changes: Use sudo nixos-rebuild switch --flake .#devbox to rebuild the NixOS system after edits in hosts/devbox.
  • Apply user changes: Use home-manager switch --flake .#dev to apply user configuration changes.
  • Full rebuild option: Execute a full rebuild from scratch with nixos-anywhere when the system is corrupted.
  • Update dependencies: Refresh flake inputs with nix flake update and commit changes.

Quick Start

  • Apply system changes after editing hosts/devbox: cd ~/projects/workstation; sudo nixos-rebuild switch --flake .#devbox
  • Apply user changes after editing users/dev/ or assets/: cd ~/projects/workstation; home-manager switch --flake .#dev
  • Full rebuild sequence: From Mac, run nixos-anywhere --flake .#devbox root@devbox; SSH in and run: cd ~/Code/workstation; home-manager switch --flake .#dev

Frequently Asked Questions about Rebuilding the Devbox

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

FAQPage Schema
How do I rebuild my NixOS devbox after configuration changes?

Rebuild your NixOS devbox by running sudo nixos-rebuild switch --flake .#devbox from ~/projects/workstation after editing hosts/devbox. This applies system configuration changes defined in your flake.

What's the difference between nixos-rebuild and home-manager in a flake setup?

nixos-rebuild applies system-level changes to the NixOS configuration, while home-manager switch applies user-level changes to your home environment. Use both to fully sync your devbox after editing hosts/devbox or users/dev/.

Can I do a full devbox rebuild from scratch with nixos-anywhere?

Yes. From a prepared Mac workstation, run nixos-anywhere --flake .#devbox root@devbox to perform a complete rebuild from scratch, then SSH in and run home-manager switch --flake .#dev to apply user configuration.

When should I use nixos-anywhere instead of incremental rebuilds?

Use nixos-anywhere for full recovery when your system is corrupted or severely misconfigured. For normal configuration updates, incremental nixos-rebuild and home-manager switches are faster and sufficient.

How do I update flake dependencies before rebuilding?

Run nix flake update to refresh flake inputs, then commit the changes. This ensures your rebuild uses current dependency versions from your flake.lock file.

Do I need both .#devbox and .#dev flake outputs configured?

Yes. .#devbox defines the NixOS system configuration for your devbox, while .#dev defines user environment settings. Both must be configured in your flake for the rebuild workflow to function.