about summary refs log tree commit diff
path: root/pkgs/tools/security/doppler
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2022-09-04 21:10:23 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2022-09-10 15:38:09 -0300
commitecce6bc552a30bc91faaacdb6e7af74188b62940 (patch)
treebbe1135521378aca3a3730472044aa41f52d4422 /pkgs/tools/security/doppler
parenteb3d3b2e9049e2fcf812e29c6636830cac3e0733 (diff)
doppler: add version test & shell completion
Diffstat (limited to 'pkgs/tools/security/doppler')
-rw-r--r--pkgs/tools/security/doppler/default.nix26
1 files changed, 23 insertions, 3 deletions
diff --git a/pkgs/tools/security/doppler/default.nix b/pkgs/tools/security/doppler/default.nix
index 904af7e5660aa..bd0c7a858e03b 100644
--- a/pkgs/tools/security/doppler/default.nix
+++ b/pkgs/tools/security/doppler/default.nix
@@ -1,4 +1,10 @@
-{ buildGoModule, fetchFromGitHub, lib }:
+{ buildGoModule
+, doppler
+, fetchFromGitHub
+, installShellFiles
+, lib
+, testers
+}:
 
 buildGoModule rec {
   pname = "doppler";
@@ -13,15 +19,29 @@ buildGoModule rec {
 
   vendorSha256 = "sha256-evG1M0ZHfn9hsMsSncwxF5Hr/VJ7y6Ir0D2gHJaunBo=";
 
-  ldflags = [ "-X github.com/DopplerHQ/cli/pkg/version.ProgramVersion=v${version}" ];
+  ldflags = [
+    "-s -w"
+    "-X github.com/DopplerHQ/cli/pkg/version.ProgramVersion=v${version}"
+  ];
+
+  nativeBuildInputs = [ installShellFiles ];
 
   postInstall = ''
     mv $out/bin/cli $out/bin/doppler
+    installShellCompletion --cmd doppler \
+      --bash <($out/bin/doppler completion bash) \
+      --fish <($out/bin/doppler completion fish) \
+      --zsh <($out/bin/doppler completion zsh)
   '';
 
+  passthru.tests.version = testers.testVersion {
+    package = doppler;
+    version = "v${version}";
+  };
+
   meta = with lib; {
-    homepage = "https://doppler.com";
     description = "The official CLI for interacting with your Doppler Enclave secrets and configuration";
+    homepage = "https://doppler.com";
     license = licenses.asl20;
     maintainers = with maintainers; [ lucperkins ];
   };