docs: add package search guidelines to CLAUDE.md

Documents the nixpkgs search workflow before writing custom packages.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Christopher Mühl 2026-02-28 01:25:33 +01:00
parent a627589a48
commit 447da21da4
No known key found for this signature in database
GPG key ID: 925AC7D69955293F

View file

@ -46,6 +46,15 @@ bosun.secrets.npmrc = { ... }; # Secret definitions
Profile definitions are in `modules/generic/profiles.nix`, implementations in `modules/nixos/profiles/`. Profile definitions are in `modules/generic/profiles.nix`, implementations in `modules/nixos/profiles/`.
## Adding packages
Before writing a custom `packages/` derivation, always check if the package already exists in nixpkgs:
- Stable: https://search.nixos.org/packages?channel=25.11&query=<name>
- Unstable: https://search.nixos.org/packages?channel=unstable&query=<name>
- Master (bleeding edge): check open PRs at https://github.com/NixOS/nixpkgs/pulls
If it exists in `unstable` or `master` but not stable, pull it via `overlays/unstable.nix` using `channels.unstable` or `channels.master`. Only write a custom `packages/` derivation as a last resort.
## Architecture patterns ## Architecture patterns
- **import-tree** auto-discovers and imports `.nix` files in `modules/flake/`. Files prefixed with `_` are excluded from auto-import. - **import-tree** auto-discovers and imports `.nix` files in `modules/flake/`. Files prefixed with `_` are excluded from auto-import.