Rebuild nix-darwin/NixOS system after dotfiles changes. Use when config files managed by Nix (lazygit, ghostty, etc.) need to be regenerated, or after editing any .nix file in the dotfiles repo.
Install
npx skillscat add edmundmiller/dotfiles/nix-rebuild Install via the SkillsCat registry.
This skill rebuilds nix-darwin or NixOS systems after changes to dotfiles managed by Nix, ensuring configuration files like lazygit and ghostty are regenerated from updated .nix files. It solves the problem that Nix store symlinks are read-only and cannot be edited in place, requiring a system rebuild for changes to take effect. Developers should use it after editing any .nix file in the dotfiles repository or when encountering permission errors writing to Nix store paths.
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 generationWhen to Rebuild
- After editing any
.nixfile - After editing config files symlinked through home-manager (lazygit, ghostty, etc.)
- When you see "permission denied" writing to a Nix store path
Workflow
- Edit source config in
~/.config/dotfiles/ - Commit changes
- Run
sudo darwin-rebuild switch --flake ~/.config/dotfiles - Verify the symlink now points to updated Nix store path