nix-refactoring

Refactor Nix configurations while preserving derivation hashes and build closures.

Updated Oct 15, 2021
One-click install
npx skills add https://github.com/toqoz/config --skill nix-refactoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nix-refactoring
Source: https://github.com/toqoz/config/tree/main/home/agents/skills/nix-refactoring
Command: npx skills add https://github.com/toqoz/config --skill nix-refactoring

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the challenge of refactoring complex Nix configurations (like Home Manager or nix-darwin) without accidentally altering system behavior or triggering expensive, unnecessary rebuilds.

Core Features & Use Cases

  • Derivation Verification: Uses Nix derivation hash comparisons to ensure structural changes do not change the final system output.
  • Closure Equivalence: Provides advanced diagnostic tools to verify that even if build artifacts change, the set of installed store paths remains identical.
  • Use Case: When splitting a massive home.nix into modular files, this skill verifies each small step to ensure your environment remains bit-identical before you commit.

Quick Start

Use the nix-refactoring skill to verify that moving my programs configuration into a separate module preserves the current system derivation.

Frequently Asked Questions about nix-refactoring

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

FAQPage Schema
How do I safely refactor a large Home Manager configuration without triggering unnecessary rebuilds?

Safely refactor Nix flake configurations by comparing derivation hashes to verify that structural reorganizations do not alter the final build closure or system state.

What is the best way to split a massive home.nix file into modular files without changing system behavior?

Split massive home.nix files into modules by applying small-step, behavior-preserving refactoring techniques that verify derivation parity at each step to ensure system behavior remains constant.

How do I verify closure equivalence when renaming files in a nix-darwin configuration?

Verify closure equivalence when renaming files in nix-darwin configurations by using advanced diagnostic tools to confirm the set of installed store paths remains identical after structural reorganization.

Can I use Nix evaluation tools to check if moving programs configuration into a separate module preserves the current system derivation?

Yes, use Nix evaluation tools to check if moving programs configuration into a separate module preserves the current system derivation by validating that the final build closure remains bit-identical.

Do I need Nix evaluation tools to perform structural reorganizations on my flake configuration?

Yes, Nix evaluation tools are required to perform structural reorganizations on flake configurations, as they enable derivation hash comparison to validate that changes do not impact the final build closure.