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 10:48:39 -07:00 committed by GitHub
parent 0dec852e05
commit 1049aef047
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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) \