From 0e88e0f1827ef508bb8599aa1d3a9943f669e437 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Mar 2026 00:43:43 -0500 Subject: [PATCH] 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. --- lua/cp/utils.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/cp/utils.lua b/lua/cp/utils.lua index 285ebf8..d300ee7 100644 --- a/lua/cp/utils.lua +++ b/lua/cp/utils.lua @@ -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)