Skip to content

feat(nix): add Nix ecosystem command handling - #3633

Open
jpds wants to merge 1 commit into
rtk-ai:developfrom
jpds:feat/nix-support
Open

feat(nix): add Nix ecosystem command handling#3633
jpds wants to merge 1 commit into
rtk-ai:developfrom
jpds:feat/nix-support

Conversation

@jpds

@jpds jpds commented Aug 22, 2026

Copy link
Copy Markdown

Summary

Takes #1046 and rebases it on the latest develop - filter nix command output (build, develop, flake, shell, env) to cut token usage: shorten store path hashes, batch download/copy progress into summaries, collapse store listings, strip evaluation traces, and keep errors and warnings intact.

Changes done on top of the previous branch:

  • Adapted to current APIs:
    • lazy_static replaced with std::sync::LazyLock
    • RtkRule entries built from ..RtkRule::DEFAULT (new pipeline_final_safe field)
    • Four nix subcommands added to the passthrough classification list checked by test_every_subcommand_is_classified
  • Error and warning lines were previously pushed verbatim (keeping full 32-char store hashes) - they now go through compress_store_paths like every other kept line
  • Fetch-plan headers ("these N paths will be fetched (... MiB ...)"), which real nix always prints with size annotations, didn't match PLAN_HEADER_RE: the header was dropped entirely and its paths leaked through uncompressed. The pattern now covers them, and the indented paths are counted into the collapsed list summary
  • Removed unused PHASE_RE; simplified ERROR_RE; merged duplicated run()/run_legacy() into one run_tool()
  • Replaced the five-parameter flush_counters() function with a module-local Counters struct

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk <command> output inspected

Important: All PRs must target the develop branch (not master).
See CONTRIBUTING.md for details.

Filter nix command output (build, develop, flake, shell, env) to cut
token usage: shorten store path hashes, batch download/copy progress
into summaries, collapse store listings, strip evaluation traces, and
keep errors and warnings intact.

Co-Authored-by: Conner Ohnesorge <cohnesorge@cottinghambutler.com>
@CLAassistant

CLAassistant commented Aug 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants