about summary refs log tree commit diff
path: root/pkgs/tools/admin/google-cloud-sdk/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/admin/google-cloud-sdk/default.nix')
-rw-r--r--pkgs/tools/admin/google-cloud-sdk/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix
index 8a9a266977737..7caa20a82ddb2 100644
--- a/pkgs/tools/admin/google-cloud-sdk/default.nix
+++ b/pkgs/tools/admin/google-cloud-sdk/default.nix
@@ -7,7 +7,7 @@
 #   3) used by `google-cloud-sdk` only on GCE guests
 #
 
-{ stdenv, lib, fetchurl, makeWrapper, python, openssl, jq, callPackage, with-gce ? false }:
+{ stdenv, lib, fetchurl, makeWrapper, python, openssl, jq, callPackage, installShellFiles, with-gce ? false }:
 
 let
   pythonEnv = python.withPackages (p: with p; [
@@ -36,7 +36,7 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [ python ];
 
-  nativeBuildInputs = [ jq makeWrapper ];
+  nativeBuildInputs = [ jq makeWrapper installShellFiles ];
 
   patches = [
     # For kubectl configs, don't store the absolute path of the `gcloud` binary as it can be garbage-collected
@@ -90,6 +90,12 @@ in stdenv.mkDerivation rec {
     # zsh doesn't load completions from $FPATH without #compdef as the first line
     sed -i '1 i #compdef gcloud' $out/share/zsh/site-functions/_gcloud
 
+    # setup fish completion
+    installShellCompletion --cmd gcloud \
+      --fish <(echo "complete -c gcloud -f -a '(__fish_argcomplete_complete gcloud)'")
+    installShellCompletion --cmd gsutil \
+      --fish <(echo "complete -c gsutil -f -a '(__fish_argcomplete_complete gsutil)'")
+
     # This directory contains compiled mac binaries. We used crcmod from
     # nixpkgs instead.
     rm -r $out/google-cloud-sdk/platform/gsutil/third_party/crcmod \