treewide: gate command execution for installShellCompletion behind buildPlatform.canExecute hostPlatform

This treewide conditions execution of the built applications for the purpose of generating shell completions behind `stdenv.buildPlatform.canExecute stdenv.hostPlatform`, which helps cross. This is a common issue I spot during review, let's prevent copy-paste errors by fixing it treewide.

Candidates were located with:

```shell
rg 'installShellCompletion' -l -tnix | xargs grep -F 'stdenv.buildPlatform.canExecute stdenv.hostPlatform' -L
```

Then I migrated the obvious cases which would not require a rebuild, as a means of testing.
This diff was not scripted. Should be zero rebuilds.

<details>
<summary>
Alternatives
</summary>

Alternatively I could have use this pattern:

```nix
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
    emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
    installShellCompletion --cmd foobar \
    --bash <(${emulator} $out/bin/foobar completion bash) \
    --fish <(${emulator} $out/bin/foobar completion fish) \
    --zsh <(${emulator} $out/bin/foobar completion zsh)
''
);
```

but that would cause rebuilds and will also require testing.

---

An other alternative is to use the binary from the corresponding package in `buildPackages`.
This however would also cause rebuilds and will also require testing.

</details>
This commit is contained in:
Peder Bergebakken Sundt
2025-09-12 14:02:48 +02:00
parent acbc6a959f
commit 8bffdd4ccf
165 changed files with 337 additions and 174 deletions

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -45,7 +46,7 @@ let
doCheck = false;
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kops \
--bash <($GOPATH/bin/kops completion bash) \
--fish <($GOPATH/bin/kops completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
buildGoModule,
coredns,
@@ -40,12 +41,14 @@ buildGoModule rec {
subPackages = map (p: "app/" + p) components;
postInstall =
lib.concatMapStringsSep "\n" (p: ''
installShellCompletion --cmd ${p} \
--bash <($out/bin/${p} completion bash) \
--fish <($out/bin/${p} completion fish) \
--zsh <($out/bin/${p} completion zsh)
'') components
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) (
lib.concatMapStringsSep "\n" (p: ''
installShellCompletion --cmd ${p} \
--bash <($out/bin/${p} completion bash) \
--fish <($out/bin/${p} completion fish) \
--zsh <($out/bin/${p} completion zsh)
'') components
)
+ lib.optionalString isFull ''
ln -sLf ${coredns}/bin/coredns $out/bin
'';

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
buildGoModule,
installShellFiles,
@@ -51,6 +52,8 @@ buildGoModule rec {
postInstall = ''
mv $out/bin/cli $out/bin/linkerd
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd linkerd \
--bash <($out/bin/linkerd completion bash) \
--zsh <($out/bin/linkerd completion zsh) \

View File

@@ -67,7 +67,7 @@ stdenv.mkDerivation {
runHook postInstall
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
HOME=$TMPDIR
installShellCompletion --cmd ${mainProgram} \
--bash <($out/bin/${mainProgram} completion bash) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -27,7 +28,7 @@ buildGoModule rec {
"-w"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd abbreviate \
--bash <($out/bin/abbreviate completion bash) \
--fish <($out/bin/abbreviate completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -30,7 +31,7 @@ buildGoModule {
"-X github.com/algolia/cli/pkg/version.Version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd algolia \
--bash <($out/bin/algolia completion bash) \
--fish <($out/bin/algolia completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
installShellFiles,
@@ -22,7 +23,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
cargoHash = "sha256-lo9JpsHkvyrEqFnIiGlU2o4rREeQeqWpe9WMwisvw+4=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd angrr \
--bash <($out/bin/angrr completion bash) \
--fish <($out/bin/angrr completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -42,7 +43,7 @@ buildGoModule rec {
"-X github.com/alexellis/arkade/pkg.Version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd arkade \
--bash <($out/bin/arkade completion bash) \
--zsh <($out/bin/arkade completion zsh) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -19,7 +20,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd astartectl \
--bash <($out/bin/astartectl completion bash) \
--fish <($out/bin/astartectl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -32,7 +33,7 @@ buildGoModule (finalAttrs: {
subPackages = [ "." ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd atlas \
--bash <($out/bin/atlas completion bash) \
--fish <($out/bin/atlas completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
installShellFiles,
buildGoModule,
@@ -20,7 +21,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd autorestic \
--bash <($out/bin/autorestic completion bash) \
--fish <($out/bin/autorestic completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -25,7 +26,7 @@ buildGoModule rec {
"-X github.com/controlplaneio/badrobot/cmd.version=v${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd badrobot \
--bash <($out/bin/badrobot completion bash) \
--fish <($out/bin/badrobot completion fish) \

View File

@@ -53,7 +53,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
autoPatchelf $out
''
+ ''
+ lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
export PATH=$PATH:$out/bin
installShellCompletion --cmd bleep \
--bash <(bleep install-tab-completions-bash --stdout) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -43,7 +44,7 @@ buildGoModule rec {
ldflags+=" -X sigs.k8s.io/release-utils/version.buildDate=$(cat SOURCE_DATE_EPOCH)"
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd bom \
--bash <($out/bin/bom completion bash) \
--fish <($out/bin/bom completion fish) \

View File

@@ -56,21 +56,22 @@ python3Packages.buildPythonApplication rec {
apprise = [ python3Packages.apprise ];
};
postInstall = ''
installShellCompletion --cmd borgmatic \
--bash <($out/bin/borgmatic --bash-completion)
''
+ lib.optionalString enableSystemd ''
mkdir -p $out/lib/systemd/system
cp sample/systemd/borgmatic.timer $out/lib/systemd/system/
# there is another "sleep", so choose the one with the space after it
# due to https://github.com/borgmatic-collective/borgmatic/commit/2e9f70d49647d47fb4ca05f428c592b0e4319544
substitute sample/systemd/borgmatic.service \
$out/lib/systemd/system/borgmatic.service \
--replace /root/.local/bin/borgmatic $out/bin/borgmatic \
--replace systemd-inhibit ${systemd}/bin/systemd-inhibit \
--replace "sleep " "${coreutils}/bin/sleep "
'';
postInstall =
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd borgmatic \
--bash <($out/bin/borgmatic --bash-completion)
''
+ lib.optionalString enableSystemd ''
mkdir -p $out/lib/systemd/system
cp sample/systemd/borgmatic.timer $out/lib/systemd/system/
# there is another "sleep", so choose the one with the space after it
# due to https://github.com/borgmatic-collective/borgmatic/commit/2e9f70d49647d47fb4ca05f428c592b0e4319544
substitute sample/systemd/borgmatic.service \
$out/lib/systemd/system/borgmatic.service \
--replace /root/.local/bin/borgmatic $out/bin/borgmatic \
--replace systemd-inhibit ${systemd}/bin/systemd-inhibit \
--replace "sleep " "${coreutils}/bin/sleep "
'';
passthru.tests = {
version = testers.testVersion { package = borgmatic; };

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -31,7 +32,7 @@ buildGoModule {
"-X github.com/buildpacks/pack.Version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd pack \
--zsh $(PACK_HOME=$PWD $out/bin/pack completion --shell zsh) \
--bash $(PACK_HOME=$PWD $out/bin/pack completion --shell bash) \

View File

@@ -29,7 +29,7 @@ rustPlatform.buildRustPackage {
];
buildInputs = [ libwebp ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd catwalk \
--bash <("$out/bin/catwalk" completion bash) \
--zsh <("$out/bin/catwalk" completion zsh) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -25,7 +26,7 @@ buildGoModule rec {
"-X main.version=v${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd chain-bench \
--bash <($out/bin/chain-bench completion bash) \
--fish <($out/bin/chain-bench completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -27,7 +28,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd changelogger \
--bash <($out/bin/changelogger completion bash) \
--fish <($out/bin/changelogger completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
"-X=main.version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd changie \
--bash <($out/bin/changie completion bash) \
--fish <($out/bin/changie completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
cilium-cli,
fetchFromGitHub,
@@ -34,7 +35,7 @@ buildGoModule rec {
# 2022/06/25 10:36:22 Unable to start gops: mkdir /homeless-shelter: permission denied
HOME = "$TMPDIR";
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd cilium \
--bash <($out/bin/cilium completion bash) \
--fish <($out/bin/cilium completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
buildGoModule,
installShellFiles,
@@ -24,7 +25,7 @@ buildGoModule rec {
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd cirrus \
--bash <($out/bin/cirrus completion bash) \
--zsh <($out/bin/cirrus completion zsh) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -36,6 +37,8 @@ buildGoModule rec {
postInstall = ''
mv $out/bin/cli $out/bin/civo
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd civo \
--bash <($out/bin/civo completion bash) \
--fish <($out/bin/civo completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -33,7 +34,7 @@ buildGoModule rec {
mv $GOPATH/bin/{cli,cliam}
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd cliam \
--bash <($out/bin/cliam completion bash) \
--fish <($out/bin/cliam completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
ttyd,
buildGoModule,
fetchFromGitHub,
@@ -33,6 +34,8 @@ buildGoModule rec {
postInstall = ''
wrapProgram $out/bin/clive --prefix PATH : ${ttyd}/bin
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd clive \
--bash <($out/bin/clive completion bash) \
--fish <($out/bin/clive completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -34,7 +35,7 @@ buildGoModule rec {
"-X ${t}.gitVersion=v${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# errors attempting to write config to read-only $HOME
export HOME=$TMPDIR

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
makeWrapper,
@@ -39,7 +40,7 @@ buildGoModule rec {
--prefix PATH : ${go}/bin
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd cobra-cli \
--bash <($out/bin/cobra-cli completion bash) \
--fish <($out/bin/cobra-cli completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -32,7 +33,7 @@ buildGoModule rec {
subPackages = [ "./cmd/copilot" ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd copilot \
--bash <($out/bin/copilot completion bash) \
--fish <($out/bin/copilot completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
"-X main.version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ctlptl \
--bash <($out/bin/ctlptl completion bash) \
--fish <($out/bin/ctlptl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -30,7 +31,7 @@ buildGoModule rec {
tags = [ "main" ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion \
--cmd datree \
--bash <($out/bin/datree completion bash) \

View File

@@ -1,5 +1,6 @@
{
buildGoModule,
stdenv,
lib,
installShellFiles,
fetchFromGitHub,
@@ -29,7 +30,7 @@ buildGoModule rec {
proxyVendor = true; # darwin/linux hash mismatch
vendorHash = "sha256-nKKCz7T6HLCBwQjPV/kpzgtR8yNiZS/Ta0H1DlKaLk8=";
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd deck \
--bash <($out/bin/deck completion bash) \
--fish <($out/bin/deck completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGo125Module,
fetchFromGitHub,
installShellFiles,
@@ -30,7 +31,7 @@ buildGo125Module rec {
"-X=github.com/StackExchange/dnscontrol/v4/pkg/version.version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd dnscontrol \
--bash <($out/bin/dnscontrol shell-completion bash) \
--zsh <($out/bin/dnscontrol shell-completion zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
"-X github.com/snyk/driftctl/build.enableUsageReporting=false"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd driftctl \
--bash <($out/bin/driftctl completion bash) \
--fish <($out/bin/driftctl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -38,7 +39,7 @@ buildGoModule rec {
"-X=github.com/homeport/dyff/internal/cmd.version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd dyff \
--bash <($out/bin/dyff completion bash) \
--fish <($out/bin/dyff completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -36,7 +37,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd eksctl \
--bash <($out/bin/eksctl completion bash) \
--fish <($out/bin/eksctl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
git,
@@ -31,7 +32,7 @@ buildGoModule rec {
nativeCheckInputs = [ git ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd enc \
--bash <($out/bin/enc completion bash) \
--fish <($out/bin/enc completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -36,7 +37,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ent \
--bash <($out/bin/ent completion bash) \
--fish <($out/bin/ent completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
sqlite,
@@ -32,7 +33,7 @@ buildGoModule rec {
"-X github.com/manojkarthick/expenses/cmd.Version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd expenses \
--bash <($out/bin/expenses completion bash) \
--zsh <($out/bin/expenses completion zsh) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
installShellFiles,
@@ -68,7 +69,7 @@ buildGoModule rec {
--set FASTLY_VICEROY_USE_PATH 1
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
export HOME="$(mktemp -d)"
installShellCompletion --cmd fastly \
--bash <($out/bin/fastly --completion-script-bash) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -58,7 +59,7 @@ buildGoModule rec {
# There are no tests for cmd/fetchit.
doCheck = false;
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for i in bash fish zsh; do
installShellCompletion --cmd fetchit \
--$i <($out/bin/fetchit completion $i)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd fioctl \
--bash <($out/bin/fioctl completion bash) \
--fish <($out/bin/fioctl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
testers,
@@ -53,7 +54,7 @@ buildGoModule rec {
runHook postCheck
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd flyctl \
--bash <($out/bin/flyctl completion bash) \
--fish <($out/bin/flyctl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -31,7 +32,7 @@ buildGoModule (finalAttrs: {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd func \
--bash <($out/bin/func completion bash) \
--zsh <($out/bin/func completion zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -22,7 +23,7 @@ buildGoModule (finalAttrs: {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd fx \
--bash <($out/bin/fx --comp bash) \
--fish <($out/bin/fx --comp fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -31,7 +32,7 @@ buildGoModule rec {
"-X=main.CommitSHA=${src.rev}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd gambit \
--bash <($out/bin/gambit completion bash) \
--fish <($out/bin/gambit completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
subPackages = [ "cmd/gator" ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd gator \
--bash <($out/bin/gator completion bash) \
--fish <($out/bin/gator completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ghorg \
--bash <($out/bin/ghorg completion bash) \
--fish <($out/bin/ghorg completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -29,7 +30,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion \
--bash $src/misc/bash/_ghq \
--fish $src/misc/fish/ghq.fish \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
buildNpmPackage,
fetchFromGitHub,
@@ -67,7 +68,7 @@ buildGoModule rec {
cp -r ${web-bundle}/bundle internal/web/root/static/bundle
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# Completions
installShellCompletion --cmd glasskube \
--bash <($out/bin/glasskube completion bash) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -35,6 +36,8 @@ buildGoModule rec {
postInstall = ''
mv $out/bin/cmd $out/bin/glooctl
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd glooctl \
--bash <($out/bin/glooctl completion bash) \
--zsh <($out/bin/glooctl completion zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -22,7 +23,7 @@ buildGoModule rec {
installShellFiles
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd gmailctl \
--bash <($out/bin/gmailctl completion bash) \
--fish <($out/bin/gmailctl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -52,7 +53,7 @@ buildGoModule rec {
ln -s ''$${bin}/bin/${bin} $out/bin/
'') bins
)
+ ''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for cmd in crane gcrane; do
installShellCompletion --cmd "$cmd" \
--bash <($GOPATH/bin/$cmd completion bash) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
go,
@@ -36,7 +37,7 @@ buildGoModule rec {
allowGoReference = true;
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd go-licenses \
--bash <("$out/bin/go-licenses" completion bash) \
--fish <("$out/bin/go-licenses" completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -23,7 +24,7 @@ buildGoModule rec {
printf ${version} > gosmee/templates/version
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd gosmee \
--bash <($out/bin/gosmee completion bash) \
--fish <($out/bin/gosmee completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -25,7 +26,7 @@ buildGoModule rec {
nativeBuildInputs = [
installShellFiles
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd goverview \
--bash <($out/bin/goverview completion bash) \
--fish <($out/bin/goverview completion fish) \

View File

@@ -112,7 +112,7 @@ buildGoModule rec {
$out/bin/alloy
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd alloy \
--bash <($out/bin/alloy completion bash) \
--fish <($out/bin/alloy completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildNpmPackage,
fetchurl,
git,
@@ -28,7 +29,7 @@ buildNpmPackage rec {
dontNpmBuild = true;
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd gt \
--bash <($out/bin/gt completion) \
--fish <(GT_PAGER= $out/bin/gt fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
git,
@@ -111,7 +112,7 @@ buildGoModule (finalAttrs: {
rm grype/db/v5/namespace/cpe/namespace_test.go
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd grype \
--bash <($out/bin/grype completion bash) \
--fish <($out/bin/grype completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -33,7 +34,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd gtrash \
--bash <($out/bin/gtrash completion bash) \
--fish <($out/bin/gtrash completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
"-X main.Version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
mv $out/bin/helm-ls $out/bin/helm_ls
installShellCompletion --cmd helm_ls \
--bash <($out/bin/helm_ls completion bash) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGo125Module,
fetchFromGitHub,
installShellFiles,
@@ -39,7 +40,7 @@ buildGo125Module rec {
wrapProgram $out/bin/helmfile \
--set HELM_PLUGINS "${pluginsDir}"
''
+ ''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd helmfile \
--bash <($out/bin/helmfile completion bash) \
--fish <($out/bin/helmfile completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
rustPlatform,
installShellFiles,
fetchFromGitHub,
@@ -21,7 +22,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd hl \
--bash <($out/bin/hl --shell-completions bash) \
--fish <($out/bin/hl --shell-completions fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
"-X github.com/guumaster/hostctl/cmd/hostctl/actions.version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd hostctl \
--bash <($out/bin/hostctl completion bash) \
--zsh <($out/bin/hostctl completion zsh)

View File

@@ -3,6 +3,7 @@
fetchFromGitHub,
installShellFiles,
lib,
stdenv,
}:
buildGoModule rec {
@@ -26,7 +27,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd humioctl \
--bash <($out/bin/humioctl completion bash) \
--zsh <($out/bin/humioctl completion zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
vendorHash = "sha256-JFvC9V0xS8SZSdLsOtpyTrFzXjYAOaPQaJHdcnJzK3s=";
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd hyprkeys \
--bash <($out/bin/hyprkeys completion bash) \
--fish <($out/bin/hyprkeys completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
makeWrapper,
@@ -27,7 +28,7 @@ rustPlatform.buildRustPackage rec {
buildInputs = [ hyprland-workspaces ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd hyprland-workspaces-tui \
--bash <($out/bin/hyprland-workspaces-tui --completions bash) \
--zsh <($out/bin/hyprland-workspaces-tui --completions zsh) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -43,7 +44,7 @@ buildGoModule rec {
"-short"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
export INFRACOST_SKIP_UPDATE_CHECK=true
installShellCompletion --cmd infracost \
--bash <($out/bin/infracost completion --shell bash) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitea,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
"-w"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ipam \
--bash <($out/bin/ipam completion bash) \
--fish <($out/bin/ipam completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -52,7 +53,7 @@ buildGoModule rec {
--replace-fail "TestGetK3sVersion" "SkipGetK3sVersion"
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd k3d \
--bash <($out/bin/k3d completion bash) \
--fish <($out/bin/k3d completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -39,7 +40,7 @@ buildGoModule rec {
"-X ${prefix}.GitVersion=v${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubectl-sigstore \
--bash <($out/bin/kubectl-sigstore completion bash) \
--fish <($out/bin/kubectl-sigstore completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -34,6 +35,8 @@ buildGoModule rec {
postInstall = ''
mv $out/bin/{kubearmor-client,karmor}
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd karmor \
--bash <($out/bin/karmor completion bash) \
--fish <($out/bin/karmor completion fish) \

View File

@@ -42,7 +42,7 @@ buildGoModule rec {
ldflags+=" -X github.com/quarkslab/kdigger/commands.GITCOMMIT=$(cat COMMIT)"
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kdigger \
--bash <($out/bin/kdigger completion bash) \
--fish <($out/bin/kdigger completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -37,7 +38,7 @@ buildGoModule rec {
"-w"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kind \
--bash <($out/bin/kind completion bash) \
--fish <($out/bin/kind completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
getent,
@@ -27,7 +28,7 @@ buildGoModule (finalAttrs: {
ldflags = [ "-X knative.dev/client/pkg/commands/version.Version=v${finalAttrs.version}" ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kn \
--bash <($out/bin/kn completion bash) \
--zsh <($out/bin/kn completion zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
gitMinimal,
@@ -55,7 +56,7 @@ buildGoModule rec {
unset GOOS GOARCH GOARM
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ko \
--bash <($out/bin/ko completion bash) \
--fish <($out/bin/ko completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
"-X github.com/plexsystems/konstraint/internal/commands.version=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd konstraint \
--bash <($out/bin/konstraint completion bash) \
--fish <($out/bin/konstraint completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -32,7 +33,7 @@ buildGoModule rec {
checkFlags = [ "-skip=TestCreateContextsWithIgnorePaths" ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kube-linter \
--bash <($out/bin/kube-linter completion bash) \
--fish <($out/bin/kube-linter completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -26,7 +27,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubecfg \
--bash <($out/bin/kubecfg completion --shell=bash) \
--zsh <($out/bin/kubecfg completion --shell=zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -31,7 +32,7 @@ buildGoModule rec {
installShellFiles
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubeone \
--bash <($out/bin/kubeone completion bash) \
--zsh <($out/bin/kubeone completion zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -27,7 +28,7 @@ buildGoModule rec {
"-X main.Commit=${version}"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd polaris \
--bash <($out/bin/polaris completion bash) \
--fish <($out/bin/polaris completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
git,
@@ -57,7 +58,7 @@ buildGoModule rec {
--replace-fail "TestSetContextMetadata" "SkipSetContextMetadata"
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubescape \
--bash <($out/bin/kubescape completion bash) \
--fish <($out/bin/kubescape completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -29,7 +30,7 @@ buildGoModule rec {
# Tests wants to download the kubernetes schema for use with kubeval
doCheck = false;
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubesec \
--bash <($out/bin/kubesec completion bash) \
--fish <($out/bin/kubesec completion fish) \

View File

@@ -3,6 +3,7 @@
fetchFromGitHub,
installShellFiles,
lib,
stdenv,
testers,
kubevirt,
}:
@@ -32,7 +33,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd virtctl \
--bash <($out/bin/virtctl completion bash) \
--fish <($out/bin/virtctl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -35,6 +36,8 @@ buildGoModule rec {
# we have no integration between krew and kubectl
# so better rename binary to kyverno and use as a standalone
mv $out/bin/kubectl-kyverno $out/bin/kyverno
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kyverno \
--bash <($out/bin/kyverno completion bash) \
--zsh <($out/bin/kyverno completion zsh) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -28,7 +29,7 @@ buildGoModule rec {
subPackages = [ "." ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd leetgo \
--bash <($out/bin/leetgo completion bash) \
--fish <($out/bin/leetgo completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -30,7 +31,7 @@ buildGoModule {
doCheck = false;
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd lefthook \
--bash <($out/bin/lefthook completion bash) \
--fish <($out/bin/lefthook completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -29,7 +30,7 @@ buildGoModule rec {
"-w"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd libgen-cli \
--bash <($out/bin/libgen-cli completion bash) \
--fish <($out/bin/libgen-cli completion fish) \

View File

@@ -4,6 +4,7 @@
installShellFiles,
kubectl,
lib,
stdenv,
}:
buildGoModule rec {
@@ -27,7 +28,7 @@ buildGoModule rec {
vendorHash = "sha256-7FYOQ89aUFPX+5NCPYKg+YGCXstQ6j9DK4V2mCgklu0=";
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd litmusctl \
--bash <($out/bin/litmusctl completion bash) \
--fish <($out/bin/litmusctl completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -27,7 +28,7 @@ buildGoModule rec {
"-w"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd madonctl \
--bash <($out/bin/madonctl completion bash) \
--zsh <($out/bin/madonctl completion zsh)

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -45,7 +46,7 @@ buildGoModule rec {
ldflags+=" -X sigs.k8s.io/release-utils/version.buildDate=$(cat SOURCE_DATE_EPOCH)"
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd melange \
--bash <($out/bin/melange completion bash) \
--fish <($out/bin/melange completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -29,7 +30,7 @@ buildGoModule (finalAttrs: {
installShellFiles
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd metal \
--bash <($out/bin/metal completion bash) \
--fish <($out/bin/metal completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
python3,
fetchFromGitHub,
installShellFiles,
@@ -51,7 +52,7 @@ python3.pkgs.buildPythonApplication rec {
(lib.makeBinPath [ awscli ])
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd nimbo \
--zsh <(_NIMBO_COMPLETE=source_zsh $out/bin/nimbo) \
--bash <(_NIMBO_COMPLETE=source_bash $out/bin/nimbo) \

View File

@@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
openssl
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd nixci \
--bash <($out/bin/nixci completion bash) \
--fish <($out/bin/nixci completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -33,7 +34,7 @@ buildGoModule (finalAttrs: {
"-X github.com/notaryproject/notation/internal/version.BuildMetadata="
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd notation \
--bash <($out/bin/notation completion bash) \
--fish <($out/bin/notation completion fish) \

View File

@@ -40,7 +40,7 @@ rustPlatform.buildRustPackage rec {
"--lib"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd novops \
--bash <($out/bin/novops completion bash) \
--fish <($out/bin/novops completion fish) \

View File

@@ -1,4 +1,5 @@
{
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -29,7 +30,7 @@ buildGoModule (finalAttrs: {
installShellFiles
writableTmpDirAsHomeHook
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd nvs \
--bash <($out/bin/nvs completion bash) \
--fish <($out/bin/nvs completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -38,7 +39,7 @@ buildGoModule rec {
"-skip=^TestCLI$"
];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ocm \
--bash <($out/bin/ocm completion bash) \
--fish <($out/bin/ocm completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -65,7 +66,7 @@ buildGoModule (finalAttrs: {
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd okteto \
--bash <($out/bin/okteto completion bash) \
--fish <($out/bin/okteto completion fish) \

View File

@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
@@ -29,7 +30,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd omnictl \
--bash <($out/bin/omnictl completion bash) \
--fish <($out/bin/omnictl completion fish) \

View File

@@ -91,7 +91,7 @@ buildGoModule (finalAttrs: {
rm v1/server/server_bench_test.go
'';
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd opa \
--bash <($out/bin/opa completion bash) \
--fish <($out/bin/opa completion fish) \

Some files were not shown because too many files have changed in this diff Show More