nix-language
Skill9 starsChanged 55 days agoMITView on GitHub
Write, explain, debug, and review Nix expressions using versioned upstream language references. Use for syntax, scope, lazy evaluation, functions, strings, paths, derivations, and built-ins; NixOS service options and Nixpkgs APIs need their own references.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- devenv-projectSkill
- home-managerSkill
- microvm-nixSkill
- nix-darwinSkill
- nixos-coding-agentsSkill
- nixos-operationsSkill
- nixos-wikiSkill
- nixpkgs-developmentSkill
- nix-workflowSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Read sources.json for the documented release and exact upstream revision.
- Distinctive: line 11
If versions differ, verify the relevant feature against the target version's manual or executable.
- Distinctive: line 15
Read the affected expression and its callers before changing it.
- Distinctive: line 19
Do not infer package APIs or service options from this language reference.
- Distinctive: line 21
Read only the relevant section of the language reference:
- Distinctive: line 31
Do not assume a function exists just because an unrelated library provides a similarly named function.
- Distinctive: line 36
Run the project's relevant checks after a change.
- Distinctive: line 43
Use controlled examples for language checks.
- Distinctive: line 44
If execution is unavailable, explain the reasoning and clearly report that validation was limited to inspection.
- Very specific: line 49
Never search /nix/store (for example find /nix/store/*foo-* -name libfoo.so) and never copy a literal store path.
- Very specific: line 53
Do not quote attribute names that are valid identifiers ([A-Za-z_][A-Za-z0-9_'-]*, dashes included).
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Nix language
Read sources.json for the documented release and exact upstream revision. Establish the project's target Nix version and evaluation mode before relying on version-sensitive behaviour. The references describe that pinned release, not necessarily the user's installed evaluator. If versions differ, verify the relevant feature against the target version's manual or executable; preserve experimental and pure-evaluation restrictions.
Working with expressions
Read the affected expression and its callers before changing it.
Trace argument bindings, attribute selection, and when values are forced.
Reuse existing project functions and conventions; choose the smallest correct change.
Distinguish language built-ins from functions supplied by Nixpkgs lib, and ordinary attribute sets from NixOS module option merging.
Do not infer package APIs or service options from this language reference.
Read only the relevant section of the language reference:
- Scope, functions, recursion:
Scoping rules,Functions,Recursive sets,Let-expressions, andWith-expressions. Lexical bindings beatwith;args@{ a ? value, ... }binds the original argument set without inserting defaults. - Values and operators:
Data Types,List,Attribute Set,Operators, andUpdate.//replaces overlapping attributes; it does not recursively merge nested sets. Parenthesise function applications used as list elements. - Evaluation:
Laziness and thunksandStrictness. A result's outer shape being evaluated does not mean its nested values have been checked. - Text and files:
String literals,Interpolated expression,Path, andString context. Paths and strings differ; interpolating a path can copy files into the store. Preserve dependency context rather than discarding it to suppress an error. - Derivations:
DerivationsandRequired. Describing a derivation, evaluating it, and building its outputs are different operations. Do not treat language derivation attributes as NixOS options.
Consult selected built-ins for exact argument behaviour and availability notices.
For built-ins or topics outside the selection, follow the versioned upstream manual links in the references.
Do not assume a function exists just because an unrelated library provides a similarly named function.
For idioms and reproducibility practice (rec, with, lookup paths, pinning, source paths), read nix.dev's best practices; it is not bundled here.
Verification
Run the project's relevant checks after a change.
For a controlled, self-contained expression, evaluate an assertion or expected result with the target Nix executable.
Syntax checks alone do not prove evaluation success; evaluation alone does not prove a derivation builds.
For lazy results, force the values the change actually affects (for example with builtins.deepSeq), rather than checking only the outer set.
Evaluation can read files, fetch inputs, or trigger builds through import-from-derivation. Inspect unknown expressions before executing them and respect the task's existing permissions. Use controlled examples for language checks; do not run upstream shell examples as setup instructions. If execution is unavailable, explain the reasoning and clearly report that validation was limited to inspection. Report the version and checks actually run; never imply other agents or evaluator versions were tested.
Nix style
- Never search
/nix/store(for examplefind /nix/store/*foo-* -name libfoo.so) and never copy a literal store path. Find the providing package withnix-locate, and refer to it through Nix:${pkgs.foo}/liborlib.makeLibraryPath [ pkgs.foo ]. - Do not quote attribute names that are valid identifiers
(
[A-Za-z_][A-Za-z0-9_'-]*, dashes included). Writepkgs.foo-barandpackages.x86_64-linux, notpkgs."foo-bar". Quote only other names (".config/foo","2.0"), the keywordsassert else if in inherit let or rec then with, and interpolations ("${name}"). Upstream examples in references sometimes quote needlessly; do not copy that style.
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.

