Skip to content

feat(nix): install LLM agent CLIs via numtide/llm-agents.nix flake input#187

Draft
fredrikaverpil wants to merge 1 commit into
mainfrom
claude/llm-agents-flake-input-68egju
Draft

feat(nix): install LLM agent CLIs via numtide/llm-agents.nix flake input#187
fredrikaverpil wants to merge 1 commit into
mainfrom
claude/llm-agents-flake-input-68egju

Conversation

@fredrikaverpil

@fredrikaverpil fredrikaverpil commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What

Replaces the bun-managed installs of the LLM agent CLIs with Nix packages from numtide/llm-agents.nix (formerly nix-ai-tools; ~1.6k stars, 100+ agents packaged, auto-updated daily, prebuilt binaries via cache.numtide.com). Alternatives considered — the forks (e.g. Qumulo/llm-agents) and single-tool flakes (e.g. sadjow/claude-code-nix) are all smaller; this is the de-facto standard flake for AI coding agents.

Before (bun, macOS-only) After (llm-agents flake input)
@openai/codex codex
@google/gemini-cli gemini-cli
@earendil-works/pi-coding-agent pi

Changes

  • flake.nix: new llm-agents input, plus cache.numtide.com substituter + trusted key in nixConfig. Deliberately no nixpkgs.follows — upstream builds/caches against its own pinned nixpkgs-unstable, and a follows would forfeit binary cache hits (same reasoning as the nixos-raspberrypi pin).
  • nix/shared/home/common.nix: codex, gemini-cli and pi added to home.packages; the three npm packages removed from packageTools.npmPackages.
  • rebuild.sh: llm-agents added to the --update-unstable input set (matches its daily release cadence).
  • CLAUDE.md: documents the new mechanism.

The bun/uv packageTools mechanism is untouched and still used for non-agent tools (@googleworkspace/cli on zap/plumbus, sqlit-tui via uv).

Behavior change

The agents were previously macOS-only (bun dynamic-linking issues on NixOS). As Nix packages they now install on all hosts, including rpi5-homelab. If you don't want them on the Pi, move the three entries from common.nix to nix/shared/home/darwin.nix's home.packages.

Manual follow-ups after merge

  1. Lock the input: flake.lock has no llm-agents entry yet. Run nix flake lock and commit (or let the first rebuild write it). CI's nix flake check locks it on the fly, so the PR is still validated.
  2. Remove the stale bun copies on macOS hosts, otherwise bun update -g keeps upgrading them alongside the Nix ones:
    bun remove -g @google/gemini-cli @openai/codex @earendil-works/pi-coding-agent
  3. First rebuild may prompt about the new substituter unless your user is in trusted-users (same note as the existing cachix one at the top of flake.nix).

@fredrikaverpil fredrikaverpil force-pushed the claude/llm-agents-flake-input-68egju branch 2 times, most recently from 669ffdf to abfa6bb Compare July 13, 2026 11:14
Replace the bun-managed installs of @google/gemini-cli, @openai/codex
and @earendil-works/pi-coding-agent with Nix packages from the
numtide/llm-agents.nix flake input (updated daily upstream, binaries
served from cache.numtide.com).

- flake.nix: add llm-agents input (no nixpkgs follows, per upstream
  guidance to keep binary cache hits) and the numtide cache/key
- common.nix: add codex, gemini-cli and pi to home.packages; drop the
  corresponding npm packages from packageTools.npmPackages
- rebuild.sh: include llm-agents in the --update-unstable input set
- CLAUDE.md: document the new mechanism

The bun/uv packageTools mechanism stays for non-agent tools such as
@googleworkspace/cli. Note: the agents are now installed on all
platforms (previously macOS-only due to bun dynamic linking issues on
NixOS).
@fredrikaverpil fredrikaverpil force-pushed the claude/llm-agents-flake-input-68egju branch from abfa6bb to 41f4203 Compare July 13, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant