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



Copy link

@offlinehacker offlinehacker commented Feb 7, 2019

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

Copy link

@mmahut mmahut commented Aug 20, 2019

Are there any updates on this pull request, please?

Copy link

@doronbehar doronbehar commented May 16, 2020

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 = ''
@@ -25,4 +36,4 @@ buildGoModule rec {
     maintainers = with lib.maintainers; [ eliasp ];
     platforms = lib.platforms.unix;
\ No newline at end of file
Copy link

@stale stale bot commented Nov 13, 2020

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

@stale stale bot added the 2.status: stale label Nov 13, 2020
Copy link

@doronbehar doronbehar commented Nov 13, 2020

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
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.