ypares/rigup.nix/nix-module-system
Claude Code and agent skill by ypares/rigup.nix
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install ypares/rigup.nix/nix-module-systemSKILL.md
Nix Module System: Dark Corners
Practical knowledge about lib.evalModules that's hard to find in official docs.
Sources:
- nixpkgs/lib/modules.nix — implementation
- Module system docs — official chapter
- nix.dev deep dive — tutorial
- noogle.dev evalModules — function reference
Module Identity & Deduplication
When the same module is included multiple times (e.g., via imports from different places), evalModules deduplicates by identity:
Path-based modules: Deduplicated by path string
Function/attrset modules: Deduplicated by key attribute
Use key when you wrap modules dynamically and need deduplication across import chains.
Module Arguments
_module.args vs specialArgs
Both inject arguments into module functions, but differ in timing:
specialArgs | _module.args | ||
|---|---|---|---|
Available in options = { ... } | ✓ | ✗ | |
Available in config = { ... } | ✓ | ✓ | |
Can reference config | ✗ | ✓ |
Rule of thumb: Use specialArgs for things needed to declare options (like lib), use _module.args for runtime values (like pkgs).
_module.check
Disable "unknown option" errors:
Useful when modules set options that might not exist (e.g., optional integrations).
_module.freeformType
Allow arbitrary attributes in config without declaring options:
Priority & Merging
mkDefault / mkForce / mkOverride
Control which definition wins when multiple modules set the same option:
mkMerge
Combine multiple config fragments:
mkIf (it's not just if)
lib.mkIf is not the same as Nix's if:
mkIf prevents "infinite recursion" errors when the condition depends on other config values.
mkBefore / mkAfter / mkOrder
For list-type options, control ordering:
Disabling Modules
Remove a module from evaluation:
Useful for replacing NixOS modules with custom implementations.
Common Errors & Fixes
See references/troubleshooting.md for detailed error explanations.
Quick fixes:
- "The option ... is defined multiple times" → Add
keyattribute or uselib.mkForce/lib.mkMerge - "infinite recursion encountered" → Use
lib.mkIfinstead ofif, or check for circular dependencies - "The option ... does not exist" → Check spelling, or set
_module.check = falsefor optional deps
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingriglets/nix-module-system/SKILL.md
Popularity
- Repository stars
- 86
- Repository forks
- 4
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ypares/rigup.nix/nix-module-system)