From 3a68b8e23d368da60ded19bcf23aaa268ae460f1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 5 Feb 2026 23:19:20 -0800 Subject: [PATCH] agents: encourage nix run/shell for ad-hoc tools --- dotfiles/agents/AGENTS.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dotfiles/agents/AGENTS.md b/dotfiles/agents/AGENTS.md index 85ef13df..e25ec079 100644 --- a/dotfiles/agents/AGENTS.md +++ b/dotfiles/agents/AGENTS.md @@ -24,3 +24,17 @@ - This system is managed with a Nix flake at `~/dotfiles/nixos`. - Use `just switch` from that directory for rebuilds instead of plain `nixos-rebuild`. - Host configs live under `machines/`; choose the appropriate host when needed. + +## Ad-hoc utilities via Nix +- If you want to use a CLI utility you know about but it is not currently available on PATH, prefer using `nix run` / `nix shell` to get it temporarily rather than installing it globally. +- Use `nix run` for a single command: + + nix run nixpkgs#ripgrep -- rg -n "pattern" . + +- Use `nix shell` when you need multiple tools available for a short sequence of commands: + + nix shell nixpkgs#{jq,ripgrep} --command bash -lc 'rg -n "pattern" . | head' + +- If you are not sure what the package is called in nixpkgs, use: + + nix search nixpkgs