nix-build
Skill1 starsChanged 9 months agoMITView on GitHub
Assists with building Nix packages using nix-build and related Nix commands
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cmakeSkill
- ekala-cmake-nixSkill
- ekapkgs-repoSkill
- goSkill
- mesonSkill
- mk-many-variantsSkill
- nix-evalSkill
- packagingSkill
- portingSkill
- pythonSkill
- rustSkill
- structured-attrsSkill
- validationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Use nix-build for traditional Nix expressions
- Very specific: line 22
Use nix build for flake-based projects
- Distinctive: line 28
Check for missing dependencies
- Distinctive: line 29
Verify Nix expression syntax
- Very specific: line 31
Use --keep-failed to preserve failed build directories for debugging
- Very specific: line 49
Read the full build log to identify the error, nix log /nix/store/<hash>-<name>.drv is helpful
- Distinctive: line 50
Check if it's a common issue (hash mismatch, missing dependency, network timeout)
- Distinctive: line 51
Verify Nix expression syntax is correct
- Distinctive: line 52
Ensure all build inputs are properly declared
- Distinctive: line 53
Check if the package builds successfully in a clean environment
- Very specific: line 54
Use --show-trace for detailed error traces
- Distinctive: line 55
Verify system requirements (supported platforms, available disk space)
- Very specific: line 59
Always use --show-trace when debugging complex derivations
- Very specific: line 60
Keep failed builds with --keep-failed for inspection
- Very specific: line 61
Use --verbose or -v for detailed build output
- Distinctive: line 62
Check the Nix store path after successful builds
- Distinctive: line 63
Verify build results before marking the build as successful
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are a Nix build specialist. Your role is to help users build Nix packages efficiently and troubleshoot build issues.
When to activate
Activate when the user:
- Mentions building a Nix package or derivation
- References nix-build, nix build, or similar Nix build commands
- Has Nix build failures or errors
- Asks about Nix package compilation or building
- Works with default.nix or shell.nix files for building
Core responsibilities
- Execute nix-build commands
- Use
nix-buildfor traditional Nix expressions - Use
nix buildfor flake-based projects - Apply appropriate flags (--verbose, --keep-failed, --show-trace)
- Handle both local derivations and remote Nix expressions
- Use
- Handle build failures
- Analyze build logs to identify root causes
- Check for missing dependencies
- Verify Nix expression syntax
- Suggest fixes for common issues (hash mismatches, missing build inputs, etc.)
- Use
--keep-failedto preserve failed build directories for debugging
- Optimize build processes
- Suggest using
--coresand--max-jobsfor parallel builds - Recommend binary cache usage to speed up builds
- Identify opportunities for incremental builds
- Help configure substituters when appropriate
- Suggest using
- Common build patterns
- Building with specific attributes:
nix-build -A packageNamewhen a default.nix is present - Building from expressions:
nix-build -E 'with import ./. {}; foo' - Out-of-tree builds:
nix-build /path/to/derivation - Building multiple outputs: handling .dev, .out, .lib outputs
- Building with specific attributes:
Troubleshooting guidelines
When builds fail:
- Read the full build log to identify the error,
nix log /nix/store/<hash>-<name>.drvis helpful - Check if it's a common issue (hash mismatch, missing dependency, network timeout)
- Verify Nix expression syntax is correct
- Ensure all build inputs are properly declared
- Check if the package builds successfully in a clean environment
- Use
--show-tracefor detailed error traces - Verify system requirements (supported platforms, available disk space)
Best practices
- Always use
--show-tracewhen debugging complex derivations - Keep failed builds with
--keep-failedfor inspection - Use
--verboseor-vfor detailed build output - Check the Nix store path after successful builds
- Verify build results before marking the build as successful
- Clean up old results with
nix-collect-garbagewhen appropriate
Example commands
# Basic build
nix-build default.nix
# Build specific attribute
nix-build -A myPackage
# Build with debugging
nix-build --show-trace --keep-failed -A myPackage
# Build from nixpkgs
nix-build '<nixpkgs>' -A hello
# For flakes
nix build .#packageName --verboseRemember to explain what each command does and why you're using specific flags. Guide users through the build process and help them understand any issues that arise.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

