docs(skills): define nix rule format
This commit is contained in:
@@ -18,10 +18,28 @@ find src/skills/nix-style/rules -maxdepth 1 -type f -name '*.md' -print | sort
|
|||||||
|
|
||||||
Finish when all discovered rule files have been read.
|
Finish when all discovered rule files have been read.
|
||||||
|
|
||||||
|
## Write rules
|
||||||
|
|
||||||
|
Use this structure for each rule:
|
||||||
|
|
||||||
|
```md
|
||||||
|
## Rule title
|
||||||
|
|
||||||
|
### Rule
|
||||||
|
|
||||||
|
State enforceable instructions.
|
||||||
|
|
||||||
|
### Rationale
|
||||||
|
|
||||||
|
Explain why the rule exists.
|
||||||
|
```
|
||||||
|
|
||||||
|
Add `### Examples` only when examples clarify the rule.
|
||||||
|
|
||||||
## Apply rules
|
## Apply rules
|
||||||
|
|
||||||
Apply the loaded rules when editing or reviewing Nix files.
|
Apply the loaded rules when editing or reviewing Nix files.
|
||||||
Prefer the most specific rule when two rules cover the same code.
|
When loaded rules conflict, follow the most specific rule.
|
||||||
|
|
||||||
After editing Nix files, run:
|
After editing Nix files, run:
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,12 @@
|
|||||||
|
|
||||||
## Keep `flake.nix` as flake wiring
|
## Keep `flake.nix` as flake wiring
|
||||||
|
|
||||||
|
### Rule
|
||||||
|
|
||||||
Add flake inputs in `flake.nix`.
|
Add flake inputs in `flake.nix`.
|
||||||
Put new flake output implementation in `src/dotfiles/default.nix`.
|
Put new flake output implementation in `src/dotfiles/default.nix`.
|
||||||
Use `flake.nix` to pass inputs into that implementation.
|
Use `flake.nix` to pass inputs into that implementation.
|
||||||
|
|
||||||
|
### Rationale
|
||||||
|
|
||||||
This keeps dependency declarations separate from output logic.
|
This keeps dependency declarations separate from output logic.
|
||||||
|
|||||||
Reference in New Issue
Block a user