diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2020-04-27 10:03:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 10:03:52 +0100 |
commit | a90356e08a994476a1a8fe35cbe41c9f99014fc8 (patch) | |
tree | 859b4600ad5eca205f61297364277779e06be6c9 /pkgs/applications/networking/cluster | |
parent | a6b85b96d4c5d8101c49661594dc5ad4eaa07656 (diff) | |
parent | 454f8ef82aa776c8fd6a3da8bcf72211c3f6cfa9 (diff) | |
download | nixlib-a90356e08a994476a1a8fe35cbe41c9f99014fc8.tar nixlib-a90356e08a994476a1a8fe35cbe41c9f99014fc8.tar.gz nixlib-a90356e08a994476a1a8fe35cbe41c9f99014fc8.tar.bz2 nixlib-a90356e08a994476a1a8fe35cbe41c9f99014fc8.tar.lz nixlib-a90356e08a994476a1a8fe35cbe41c9f99014fc8.tar.xz nixlib-a90356e08a994476a1a8fe35cbe41c9f99014fc8.tar.zst nixlib-a90356e08a994476a1a8fe35cbe41c9f99014fc8.zip |
Merge pull request #86035 from zowoq/go-fixes
Diffstat (limited to 'pkgs/applications/networking/cluster')
4 files changed, 24 insertions, 21 deletions
diff --git a/pkgs/applications/networking/cluster/docker-machine/default.nix b/pkgs/applications/networking/cluster/docker-machine/default.nix index 321084260320..a801a1223744 100644 --- a/pkgs/applications/networking/cluster/docker-machine/default.nix +++ b/pkgs/applications/networking/cluster/docker-machine/default.nix @@ -1,5 +1,5 @@ # This file was generated by go2nix. -{ stdenv, buildGoPackage, fetchFromGitHub }: +{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles }: buildGoPackage rec { pname = "machine"; @@ -14,13 +14,13 @@ buildGoPackage rec { sha256 = "0xxzxi5v7ji9j2k7kxhi0ah91lfa7b9rg3nywgx0lkv8dlgp8kmy"; }; - postInstall = '' - mkdir -p \ - $bin/share/bash-completion/completions/ \ - $bin/share/zsh/site-functions/ + nativeBuildInputs = [ installShellFiles ]; - cp go/src/github.com/docker/machine/contrib/completion/bash/* $bin/share/bash-completion/completions/ - cp go/src/github.com/docker/machine/contrib/completion/zsh/* $bin/share/zsh/site-functions/ + postInstall = '' + pushd go/src/${goPackagePath}/contrib/completion + installShellCompletion --bash bash/* + installShellCompletion --zsh zsh/* + popd ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/networking/cluster/kompose/default.nix b/pkgs/applications/networking/cluster/kompose/default.nix index 09a69f4b80e2..2467ed93b32c 100644 --- a/pkgs/applications/networking/cluster/kompose/default.nix +++ b/pkgs/applications/networking/cluster/kompose/default.nix @@ -15,9 +15,10 @@ buildGoPackage rec { nativeBuildInputs = [ installShellFiles ]; postInstall = '' - $bin/bin/kompose completion bash > kompose.bash - $bin/bin/kompose completion zsh > kompose.zsh - installShellCompletion kompose.{bash,zsh} + for shell in bash zsh; do + $bin/bin/kompose completion $shell > kompose.$shell + installShellCompletion kompose.$shell + done ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/kops/default.nix b/pkgs/applications/networking/cluster/kops/default.nix index a5f1806e5779..4d2e406c0400 100644 --- a/pkgs/applications/networking/cluster/kops/default.nix +++ b/pkgs/applications/networking/cluster/kops/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata }: +{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }: let goPackagePath = "k8s.io/kops"; @@ -18,7 +18,7 @@ let inherit sha256; }; - nativeBuildInputs = [ go-bindata ]; + nativeBuildInputs = [ go-bindata installShellFiles ]; subPackages = [ "cmd/kops" ]; buildFlagsArray = '' @@ -33,10 +33,10 @@ let ''; postInstall = '' - mkdir -p $bin/share/bash-completion/completions - mkdir -p $bin/share/zsh/site-functions - $bin/bin/kops completion bash > $bin/share/bash-completion/completions/kops - $bin/bin/kops completion zsh > $bin/share/zsh/site-functions/_kops + for shell in bash zsh; do + $bin/bin/kops completion $shell > kops.$shell + installShellCompletion kops.$shell + done ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/networking/cluster/stern/default.nix b/pkgs/applications/networking/cluster/stern/default.nix index 144d46043ffe..95ad965c346f 100644 --- a/pkgs/applications/networking/cluster/stern/default.nix +++ b/pkgs/applications/networking/cluster/stern/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub }: +{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub, installShellFiles }: let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform; in @@ -17,13 +17,15 @@ buildGoPackage rec { goDeps = ./deps.nix; + nativeBuildInputs = [ installShellFiles ]; + postInstall = let stern = if isCrossBuild then buildPackages.stern else "$bin"; in '' - mkdir -p $bin/share/bash-completion/completions - ${stern}/bin/stern --completion bash > $bin/share/bash-completion/completions/stern - mkdir -p $bin/share/zsh/site-functions - ${stern}/bin/stern --completion zsh > $bin/share/zsh/site-functions/_stern + for shell in bash zsh; do + ${stern}/bin/stern --completion $shell > stern.$shell + installShellCompletion stern.$shell + done ''; meta = with lib; { |