fix(utils): discover nix submitEnv dynamically in dev checkout

Problem: In a dev checkout, `_nix_submit_cmd` is nil (only baked in by
the nix derivation). The uv fallback fails with code 127 on NixOS because
`uv` is not a bare system binary — it's only available via the FHS-wrapped
`cp-nvim-submit` script produced by `mkSubmitEnv`.

Solution: Add `discover_nix_submit_cmd` mirroring `discover_nix_python`:
runs `nix build #submitEnv --no-link --print-out-paths`, caches the result
in `stdpath('cache')/cp-nvim/nix-submit`, and sets `_nix_submit_cmd`.
`run_scraper` calls `setup_nix_submit_env()` before spawning submit.
This commit is contained in:
Barrett Ruth 2026-03-04 19:22:57 -05:00
parent 128ff04621
commit 690469bd99
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 69 additions and 0 deletions

View file

@ -44,6 +44,10 @@ local function run_scraper(platform, subcommand, args, opts)
return { success = false, error = msg }
end
if subcommand == 'submit' then
utils.setup_nix_submit_env()
end
local plugin_path = utils.get_plugin_path()
local cmd
if subcommand == 'submit' then