+AGENTS.md

This commit is contained in:
m3tm3re
2025-12-27 10:16:52 +01:00
parent d7d64634ee
commit 9092e6d18d

26
AGENTS.md Normal file
View File

@@ -0,0 +1,26 @@
# Agent Guidelines for m3ta-nixpkgs
## Build/Lint/Test Commands
- `nix flake check` - Validate flake and run checks
- `nix fmt` - Format all Nix files (uses nixpkgs-fmt)
- `nix build .#<package>` - Build a specific package
- `nix flake show` - List all available outputs
- `statix check .` - Lint Nix files (run in `nix develop` shell)
- `deadnix .` - Find dead/unused Nix code (run in `nix develop` shell)
## Code Style
- **Formatter**: Always run `nix fmt` before committing
- **Naming**: Package names use lowercase-hyphen (`my-package`), variables use camelCase
- **Imports**: Multi-line with trailing commas: `{ lib, stdenv, fetchFromGitHub, }:`
- **Modules**: Use `with lib; let cfg = config.namespace.module; in { ... }` pattern
- **Options**: Use `mkEnableOption` for enable flags, namespace under `m3ta.*`
- **Meta**: Always include description, homepage, license, platforms, mainProgram
- **Comments**: Explain "why" not "what"; document non-obvious logic
## File Organization
- One package per directory under `pkgs/`, entry point is `default.nix`
- Register packages in `pkgs/default.nix` using `callPackage`
- Modules go in `modules/nixos/` or `modules/home-manager/` by category
## Commit Format
`type: brief description` where type is: feat, fix, docs, style, refactor, chore