about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/terraform
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2023-03-31 08:20:33 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2023-03-31 09:00:46 +1000
commit84bc58c403214eba55047e429d7ea6c26e2ab149 (patch)
tree663aec7e547f29c29c513e9bf5c48d586e6b401e /pkgs/applications/networking/cluster/terraform
parent95240914dd56e65b6a6db43e9e69aba07fd78aab (diff)
downloadnixlib-84bc58c403214eba55047e429d7ea6c26e2ab149.tar
nixlib-84bc58c403214eba55047e429d7ea6c26e2ab149.tar.gz
nixlib-84bc58c403214eba55047e429d7ea6c26e2ab149.tar.bz2
nixlib-84bc58c403214eba55047e429d7ea6c26e2ab149.tar.lz
nixlib-84bc58c403214eba55047e429d7ea6c26e2ab149.tar.xz
nixlib-84bc58c403214eba55047e429d7ea6c26e2ab149.tar.zst
nixlib-84bc58c403214eba55047e429d7ea6c26e2ab149.zip
Revert "terraform: add completion"
This reverts commit 701f8d5f6d67a3dd3db7091ca59c0274839a60a0.

doesn't work
Diffstat (limited to 'pkgs/applications/networking/cluster/terraform')
-rw-r--r--pkgs/applications/networking/cluster/terraform/default.nix52
1 files changed, 19 insertions, 33 deletions
diff --git a/pkgs/applications/networking/cluster/terraform/default.nix b/pkgs/applications/networking/cluster/terraform/default.nix
index 4fc379ae2384..215e3a781866 100644
--- a/pkgs/applications/networking/cluster/terraform/default.nix
+++ b/pkgs/applications/networking/cluster/terraform/default.nix
@@ -9,7 +9,6 @@
 , writeText
 , terraform-providers
 , fetchpatch
-, installShellFiles
 }:
 
 let
@@ -29,38 +28,12 @@ let
 
       ldflags = [ "-s" "-w" ];
 
-      subPackages = [ "." ];
-
       postConfigure = ''
         # speakeasy hardcodes /bin/stty https://github.com/bgentry/speakeasy/issues/22
         substituteInPlace vendor/github.com/bgentry/speakeasy/speakeasy_unix.go \
           --replace "/bin/stty" "${coreutils}/bin/stty"
       '';
 
-      nativeBuildInputs = [ installShellFiles ];
-
-      preCheck = ''
-        export HOME=$TMPDIR
-        export TF_SKIP_REMOTE_TESTS=1
-      '';
-
-      # https://github.com/posener/complete/blob/9a4745ac49b29530e07dc2581745a218b646b7a3/cmd/install/bash.go#L8
-      completionBash = "complete -C terraform terraform\n";
-      # https://github.com/posener/complete/blob/9a4745ac49b29530e07dc2581745a218b646b7a3/cmd/install/zsh.go
-      completionZsh =  "complete -C terraform terraform\n";
-      # https://github.com/posener/complete/blob/9a4745ac49b29530e07dc2581745a218b646b7a3/cmd/install/fish.go#L56
-      completionFish = ''
-        function __complete_terraform
-            set -lx COMP_LINE (commandline -cp)
-            test -z (commandline -ct)
-            and set COMP_LINE "$COMP_LINE "
-            terraform
-        end
-        complete -f -c terraform -a "(__complete_terraform)"
-      '';
-
-      passAsFile = [ "completionBash" "completionZsh" "completionFish" ];
-
       postInstall = ''
         # remove all plugins, they are part of the main binary now
         for i in $out/bin/*; do
@@ -68,19 +41,32 @@ let
             rm "$i"
           fi
         done
+      '';
 
-        installShellCompletion --bash --name terraform $completionBashPath
-        installShellCompletion --zsh --name terraform $completionZshPath
-        installShellCompletion --fish --name terraform $completionFishPath
+      preCheck = ''
+        export HOME=$TMPDIR
+        export TF_SKIP_REMOTE_TESTS=1
       '';
 
-      meta = {
+      subPackages = [ "." ];
+
+      meta = with lib; {
         description =
           "Tool for building, changing, and versioning infrastructure";
         homepage = "https://www.terraform.io/";
         changelog = "https://github.com/hashicorp/terraform/blob/v${version}/CHANGELOG.md";
-        license = lib.licenses.mpl20;
-        maintainers = with lib.maintainers; [ Chili-Man babariviere kalbasit marsam maxeaubrey techknowlogick timstott zimbatm zowoq ];
+        license = licenses.mpl20;
+        maintainers = with maintainers; [
+          Chili-Man
+          babariviere
+          kalbasit
+          marsam
+          maxeaubrey
+          timstott
+          zimbatm
+          zowoq
+          techknowlogick
+        ];
       };
     } // attrs');