diff --git a/CLAUDE.md b/CLAUDE.md index d05e74d..895bc46 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -49,6 +49,15 @@ - If an approach fails twice, stop and reassess rather than continuing to iterate - Present the failure clearly and propose an alternative before proceeding +## Nix +- Nix is the preferred meta package manager on all systems — assume it is available even on non-NixOS Linux +- Always prefer a project-level `flake.nix` as the canonical way to define dev environments, build systems, and scripts +- Dev environments go in `devShells`, project scripts/tools go in `packages` or as `apps` within the flake +- Never suggest `apt`, `brew`, `pip install --user`, `npm install -g`, or other imperative global installs — reach for `nix shell`, `nix run`, or the project devshell instead +- Prefer `nix run` for one-off tool invocations and `nix develop` (or `direnv` + `use flake`) for persistent dev shells +- Binaries and tools introduced to a project should be pinned and run through Nix, not assumed to be on `$PATH` from the host +- Flakes are the preferred interface — avoid legacy `nix-env` or channel-based patterns + ## Research Before Acting - Before implementing a solution, research it — read relevant documentation, search for existing patterns, check official sources - Do not reason from first principles when documentation or prior art exists