kubevela: use writableTmpDirAsHomeHook
This commit is contained in:
@@ -2,13 +2,16 @@
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
writableTmpDirAsHomeHook,
|
||||
lib,
|
||||
stdenv,
|
||||
testers,
|
||||
kubevela,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
let
|
||||
canGenerateShellCompletions = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
in
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "kubevela";
|
||||
version = "1.10.6";
|
||||
@@ -30,11 +33,7 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
subPackages = [ "references/cmd/cli" ];
|
||||
|
||||
env = {
|
||||
CGO_ENABLED = 0;
|
||||
# Workaround for permission issue in shell completion
|
||||
HOME = "$TMPDIR";
|
||||
};
|
||||
env.CGO_ENABLED = 0;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
@@ -42,8 +41,14 @@ buildGoModule (finalAttrs: {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
]
|
||||
++ lib.optionals canGenerateShellCompletions [
|
||||
writableTmpDirAsHomeHook # Workaround for permission issue in shell completion
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString canGenerateShellCompletions ''
|
||||
installShellCompletion --cmd vela \
|
||||
--bash <($out/bin/vela completion bash) \
|
||||
--zsh <($out/bin/vela completion zsh)
|
||||
|
||||
Reference in New Issue
Block a user