summary refs log tree commit diff
path: root/pkgs/development/tools/hcloud/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/hcloud/default.nix')
-rw-r--r--pkgs/development/tools/hcloud/default.nix29
1 files changed, 12 insertions, 17 deletions
diff --git a/pkgs/development/tools/hcloud/default.nix b/pkgs/development/tools/hcloud/default.nix
index bdaf04054e9..0044426b4d4 100644
--- a/pkgs/development/tools/hcloud/default.nix
+++ b/pkgs/development/tools/hcloud/default.nix
@@ -1,40 +1,35 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "hcloud";
-  version = "1.16.2";
-
-  goPackagePath = "github.com/hetznercloud/cli";
+  version = "1.17.0";
 
   src = fetchFromGitHub {
     owner = "hetznercloud";
     repo = "cli";
     rev = "v${version}";
-    sha256 = "0cxh92df8gdl4bmr22pdvdxdkdjyfy0jv48y0k6awy1xz61r94ap";
+    sha256 = "1brqqcyyljkdd24ljx2qbr648ihhhmr8mq6gs90n63r59ci6ksch";
   };
 
-  modSha256 = "1sdp62q4rnx7dp4i0dhnc8kzi8h6zzjdy7ym0mk9r7xkxxx0s3ds";
+  nativeBuildInputs = [ installShellFiles ];
 
-  buildFlagsArray = [ "-ldflags=" "-w -X github.com/hetznercloud/cli/cli.Version=${version}" ];
+  vendorSha256 = "1m96j9cwqz2b67byf53qhgl3s0vfwaklj2pm8364qih0ilvifppj";
 
-  postInstall = ''
-    mkdir -p \
-      $out/etc/bash_completion.d \
-      $out/share/zsh/vendor-completions
+  doCheck = false;
 
-    # Add bash completions
-    $out/bin/hcloud completion bash > "$out/etc/bash_completion.d/hcloud"
+  buildFlagsArray = [ "-ldflags=-s -w -X github.com/hetznercloud/cli/cli.Version=${version}" ];
 
-    # Add zsh completions
-    echo "#compdef hcloud" > "$out/share/zsh/vendor-completions/_hcloud"
-    $out/bin/hcloud completion zsh >> "$out/share/zsh/vendor-completions/_hcloud"
+  postInstall = ''
+    for shell in bash zsh; do
+      $out/bin/hcloud completion $shell > hcloud.$shell
+      installShellCompletion hcloud.$shell
+    done
   '';
 
   meta = {
     description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
     homepage = "https://github.com/hetznercloud/cli";
     license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.all;
     maintainers = [ stdenv.lib.maintainers.zauberpony ];
   };
 }