rebuild

Automates applying Nix-based dotfiles configuration changes with a dry-run validation.

3|Updated Jul 17, 2024
One-click install
npx skills add https://github.com/Castrozan/.dotfiles --skill rebuild
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebuild
Source: https://github.com/Castrozan/.dotfiles/tree/main/agents/skills/rebuild
Command: npx skills add https://github.com/Castrozan/.dotfiles --skill rebuild

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates applying configuration changes to a Nix-based dotfiles environment, reducing manual rebuild steps.

Core Features & Use Cases

  • Unified workflow: Stage changes, run a dry-run, and apply updates across NixOS and non-NixOS environments.
  • Reliable rebuilds: Rebuilds the system or user configuration with correct context and automatic backup naming.
  • Use Case: After editing a .nix file or updating a flake, trigger a safe rebuild to apply changes without manual reboot or split commands.

Quick Start

Stage changed files: git add path/to/changed.nix Dry-run to validate (NixOS): nix build ~/.dotfiles#nixosConfigurations.USER.config.system.build.toplevel --dry-run Dry-run to validate (non-NixOS): home-manager build --flake ~/.dotfiles#USER@x86_64-linux --dry-run If dry-run passes, apply: ./bin/rebuild Verify changes took effect

Frequently Asked Questions about rebuild

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

FAQPage Schema
How do I apply NixOS configuration changes after editing a flake?

To apply NixOS configuration changes, you need to stage the modified files, run a dry-run validation, and execute a rebuild command to switch the system safely.

Can I use home-manager to rebuild dotfiles on a non-NixOS system?

Yes, home-manager can rebuild dotfiles on a non-NixOS system by running a build command with the flake path and target hostname to validate and apply user configuration.

What is the best way to validate a Nix flake before switching configurations?

The best way to validate a Nix flake before switching is to perform a dry-run build, which checks the configuration for errors without applying changes to your environment.

Do I need to install the nix command to use a rebuild workflow?

Yes, the nix command is required to execute the rebuild workflow, and the optional home-manager command is needed if you are managing user-level dotfiles on non-NixOS systems.

Why should I stage files with git add before a NixOS rebuild?

You should stage files with git add before a NixOS rebuild because Nix flakes track git state, ensuring the build process includes your latest configuration changes accurately.

Does applying Home Manager changes require a manual reboot?

No, applying Home Manager changes does not require a manual reboot; the rebuild workflow automatically switches the system or user configuration and handles backup naming.