From 1049aef047ba3e922b6fd369907c84159206539b Mon Sep 17 00:00:00 2001 From: Paul Nicholson Date: Mon, 22 Jul 2024 10:48:39 -0700 Subject: [PATCH] doppler: fix build failure with shell completion (#326008) Sets the HOME environment variable to a temporary dir, as the cli attempts to run a setup routine which creates a directory under the user's home Fixes #325915 also fix cross-compilation --- pkgs/by-name/do/doppler/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/do/doppler/package.nix b/pkgs/by-name/do/doppler/package.nix index 29537bcb9abb..f3fbfe1caf20 100644 --- a/pkgs/by-name/do/doppler/package.nix +++ b/pkgs/by-name/do/doppler/package.nix @@ -4,6 +4,7 @@ , installShellFiles , lib , testers +, stdenv }: buildGoModule rec { @@ -28,6 +29,9 @@ buildGoModule rec { postInstall = '' mv $out/bin/cli $out/bin/doppler + '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + export HOME=$TMPDIR + mkdir $HOME/.doppler # to avoid race conditions below installShellCompletion --cmd doppler \ --bash <($out/bin/doppler completion bash) \ --fish <($out/bin/doppler completion fish) \