Nix

Guide Nix, NixOS, and home-manager configuration with best practices.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/vdemeester/home --skill nix-vdemeester
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Nix
Source: https://github.com/vdemeester/home/tree/main/dots/.config/claude/skills/Nix
Command: npx skills add https://github.com/vdemeester/home --skill nix-vdemeester

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides you through expert Nix, NixOS, and home-manager practices to create reproducible, modular, and well-documented configurations. It helps you avoid drift, promotes declarative setups, and standardizes how Nix expressions, flakes, and home-manager integrations are developed and maintained.

Core Features & Use Cases

  • Declarative Configuration Guidance: Establish consistent patterns for NixOS and home-manager.
  • Reproducibility Practices: Pin versions, use flakes, lock files, and containerized builds.
  • Modularity & Documentation: Promote composable modules with clear provenance and rationale.

Quick Start

Create a minimal flake-based host configuration and verify it with a dry build using sample host definitions.

Frequently Asked Questions about Nix

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

FAQPage Schema
How do I set up a reproducible NixOS configuration with flakes?

Reproducible NixOS configurations with flakes use pinned dependencies and lock files to guarantee identical builds across environments. Create a flake.nix file that declares your system configuration, run `nix flake update` to generate flake.lock, and commit both to version control. This ensures every rebuild produces the same result.

What's the best way to structure modular NixOS and home-manager configurations?

Modular Nix configurations use composable modules that separate concerns—hardware, software, services—into reusable files. Organize modules by function, document the intent and dependencies of each, and import them into a central flake.nix. This pattern eliminates drift and makes configurations easier to maintain and version control.

How do I avoid configuration drift in declarative NixOS setups?

Declarative configuration drift is prevented by treating your entire system state as code in version control. Use flakes to pin all dependencies, apply configurations atomically with `nixos-rebuild`, and regularly rebuild to catch divergence. This ensures your actual system always matches your declared configuration.

Can I use home-manager with NixOS for user-level configuration?

Home-manager integrates with NixOS to manage user environments declaratively—dotfiles, packages, services—alongside system configuration. Add home-manager as a flake input, import its NixOS module, and define user configurations in home.nix. Both system and user state remain reproducible and version-controlled together.

What are the limitations of flake-based Nix configurations?

Flakes lock all dependencies at evaluation time, which can make ad-hoc customizations harder. They require explicit input declarations and add complexity compared to simple nix expressions. Flakes also demand discipline around lock file management and aren't suitable for highly dynamic, frequently-changing environments.

How do I debug NixOS configuration errors before deploying?

Use `nix flake check` to validate your flake structure and `nixos-rebuild dry-build` to evaluate configurations without applying changes. These catch syntax errors, missing dependencies, and configuration conflicts early. For deeper inspection, use `nix repl` to test expressions interactively.