fix(utils): skip uv python setup on NixOS

Problem: uv downloads glibc-linked Python binaries that NixOS cannot
run, causing setup_python_env to fail with exit status 127.

Solution: detect NixOS via /etc/NIXOS and bypass the uv sync path,
falling through directly to nix-based Python discovery.
This commit is contained in:
Barrett Ruth 2026-03-03 00:43:43 -05:00 committed by Barrett Ruth
parent add022af8c
commit 0e88e0f182

View file

@ -175,7 +175,9 @@ function M.setup_python_env()
return true
end
if vim.fn.executable('uv') == 1 then
local on_nixos = vim.fn.filereadable('/etc/NIXOS') == 1
if not on_nixos and vim.fn.executable('uv') == 1 then
local plugin_path = M.get_plugin_path()
logger.log('Python env: uv sync (dir=' .. plugin_path .. ')')
vim.notify('[cp.nvim] Setting up Python environment...', vim.log.levels.INFO)