Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hetzner-kube: support for bash completion #55404

Closed

Conversation

offlinehacker
Copy link
Contributor

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@mmahut
Copy link
Member

mmahut commented Aug 20, 2019

Are there any updates on this pull request, please?

@doronbehar
Copy link
Contributor

The hetzner-kube cli syntax has changed so it'll be better to make this PR's diff this:

diff --git i/pkgs/applications/networking/cluster/hetzner-kube/default.nix w/pkgs/applications/networking/cluster/hetzner-kube/default.nix
index 98edd849bac..dbd2359d046 100644
--- i/pkgs/applications/networking/cluster/hetzner-kube/default.nix
+++ w/pkgs/applications/networking/cluster/hetzner-kube/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "hetzner-kube";
@@ -13,6 +13,17 @@ buildGoModule rec {
 
   vendorSha256 = "1jh2f66ys6rmrrwrf5zqfprgcvziyq6l4z8bfqwxgf1ysnxx525h";
 
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  postInstall = ''
+    $out/bin/hetzner-kube completion bash > hetzner-kube
+    $out/bin/hetzner-kube completion zsh > _hetzner-kube
+    installShellCompletion --zsh _hetzner-kube
+    installShellCompletion --bash hetzner-kube
+  '';
+
   buildFlagsArray = ''
     -ldflags=
     -X github.com/xetys/hetzner-kube/cmd.version=${version}
@@ -25,4 +36,4 @@ buildGoModule rec {
     maintainers = with lib.maintainers; [ eliasp ];
     platforms = lib.platforms.unix;
   };
-}
\ No newline at end of file
+}

@stale
Copy link

stale bot commented Nov 13, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 13, 2020
@doronbehar
Copy link
Contributor

Closing in favor of #103665 .

@doronbehar doronbehar closed this Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants