From 3d600264dc2ffab5deffc04237dba407deff6245 Mon Sep 17 00:00:00 2001 From: zzbaron Date: Thu, 11 Sep 2025 10:58:06 -0400 Subject: nix support: adjustments pointed out by ruki --- xmake/modules/detect/tools/find_nix.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xmake/modules/detect/tools') diff --git a/xmake/modules/detect/tools/find_nix.lua b/xmake/modules/detect/tools/find_nix.lua index 33a056320..52531e029 100644 --- a/xmake/modules/detect/tools/find_nix.lua +++ b/xmake/modules/detect/tools/find_nix.lua @@ -45,10 +45,15 @@ function main(opt) local nix_paths = { "/nix/var/nix/profiles/default/bin", -- multi-user installation "/home/" .. (os.getenv("USER") or "user") .. "/.nix-profile/bin", -- single user installation - "/run/current-system/sw/bin", -- only on nixos, maybe separate nix logic from nixos logic? "/usr/local/bin", -- default path of nix when compiling nix from source } + + -- NixOS-specific paths + if linuxos.name() == "nixos" then + table.insert(nix_paths, "/run/current-system/sw/bin") + end + opt.paths = table.wrap(opt.paths) for _, nixpath in ipairs(nix_paths) do table.insert(opt.paths, nixpath) end -- cgit v1.3.1