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:
parent
add022af8c
commit
0e88e0f182
1 changed files with 3 additions and 1 deletions
|
|
@ -175,7 +175,9 @@ function M.setup_python_env()
|
||||||
return true
|
return true
|
||||||
end
|
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()
|
local plugin_path = M.get_plugin_path()
|
||||||
logger.log('Python env: uv sync (dir=' .. plugin_path .. ')')
|
logger.log('Python env: uv sync (dir=' .. plugin_path .. ')')
|
||||||
vim.notify('[cp.nvim] Setting up Python environment...', vim.log.levels.INFO)
|
vim.notify('[cp.nvim] Setting up Python environment...', vim.log.levels.INFO)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue