From b093fe18975351e86656cfc32780642c6d62bc57 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Mon, 2 Feb 2026 20:19:44 -0500 Subject: [PATCH] gopls: fix build in darwin sandbox The versionCheckHook clears the environment, so gopls fails to create its cache directory as it defaults to a read-only dir. Pass TMPDIR to fix. See https://github.com/NixOS/nixpkgs/issues/473777 --- pkgs/by-name/go/gopls/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/go/gopls/package.nix b/pkgs/by-name/go/gopls/package.nix index 52a0b10e9ec8..2e7979f6822c 100644 --- a/pkgs/by-name/go/gopls/package.nix +++ b/pkgs/by-name/go/gopls/package.nix @@ -36,6 +36,7 @@ buildGoLatestModule (finalAttrs: { doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckKeepEnvironment = [ "TMPDIR" ]; versionCheckProgramArg = "version"; passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=gopls/(.*)" ]; };