feat(skills): add nix style guidance
This commit is contained in:
32
src/skills/nix-style/SKILL.md
Normal file
32
src/skills/nix-style/SKILL.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: nix-style
|
||||
description: Repository Nix style, architecture, and check conventions. Use when editing or reviewing Nix files in this repository.
|
||||
---
|
||||
|
||||
# nix-style
|
||||
|
||||
Use this skill as the source of truth for repository Nix conventions.
|
||||
|
||||
## Load rules
|
||||
|
||||
Read every Markdown file under [`rules/`](rules/) before applying this skill.
|
||||
Use this command from the skill directory when file names are unknown:
|
||||
|
||||
```bash
|
||||
find rules -type f -name '*.md' -print | sort
|
||||
```
|
||||
|
||||
Finish when all discovered rule files have been read.
|
||||
|
||||
## Apply rules
|
||||
|
||||
Apply the loaded rules when editing or reviewing Nix files.
|
||||
Prefer the most specific rule when two rules cover the same code.
|
||||
|
||||
After editing Nix files, run:
|
||||
|
||||
```bash
|
||||
nix run .#fix
|
||||
```
|
||||
|
||||
Finish when the Nix change follows the loaded rules.
|
||||
9
src/skills/nix-style/rules/flake.md
Normal file
9
src/skills/nix-style/rules/flake.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Flake rules
|
||||
|
||||
## Keep `flake.nix` as flake wiring
|
||||
|
||||
Add flake inputs in `flake.nix`.
|
||||
Put new flake output implementation in `src/dotfiles/default.nix`.
|
||||
Use `flake.nix` to pass inputs into that implementation.
|
||||
|
||||
This keeps dependency declarations separate from output logic.
|
||||
Reference in New Issue
Block a user