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
This commit is contained in:
Paul Nicholson
2024-07-22 19:48:39 +02:00
committed by GitHub
parent 0dec852e05
commit 1049aef047
+4
View File
@@ -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) \