fix: exec shellCompletion only if not crosscompiled #308283

This commit is contained in:
Kris Budde 2024-05-11 18:54:23 +02:00
parent d123209ade
commit b83a7a9a7f
No known key found for this signature in database

View File

@ -1,4 +1,5 @@
{ lib, buildGoModule, fetchFromGitHub, testers, installShellFiles, myks, }:
{ lib, buildGoModule, fetchFromGitHub, testers, installShellFiles, myks, stdenv
}:
buildGoModule rec {
pname = "myks";
@ -29,15 +30,16 @@ buildGoModule rec {
passthru.tests.version = testers.testVersion { package = myks; };
postInstall = ''
installShellCompletion --cmd myks \
--bash <($out/bin/myks completion bash) \
--zsh <($out/bin/myks completion zsh) \
--fish <($out/bin/myks completion fish)
'';
postInstall =
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd myks \
--bash <($out/bin/myks completion bash) \
--zsh <($out/bin/myks completion zsh) \
--fish <($out/bin/myks completion fish)
'';
meta = with lib; {
changelog = "https://github.com/mykso/myks/blob/main/CHANGELOG.md";
changelog = "https://github.com/mykso/myks/blob/v${version}/CHANGELOG.md";
description = "A configuration framework for Kubernetes applications";
license = licenses.mit;
homepage = "https://github.com/mykso/myks";