about summary refs log tree commit diff
path: root/pkgs/by-name/va
diff options
context:
space:
mode:
authortechknowlogick2024-09-25 22:09:44 -0400
committertechknowlogick2024-09-25 22:09:44 -0400
commit45f4361477374da95de9279c19abfe8941757817 (patch)
tree8aa46891a651aa65cc58ace1e6b3e5b9b88f9fe8 /pkgs/by-name/va
parent306c5e55e7d05ff41756f28fd3b44c6fa1aee4bd (diff)
vault: move to pkgs/by-name
Diffstat (limited to 'pkgs/by-name/va')
-rw-r--r--pkgs/by-name/va/vault/package.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/by-name/va/vault/package.nix b/pkgs/by-name/va/vault/package.nix
new file mode 100644
index 000000000000..38b481cf28cf
--- /dev/null
+++ b/pkgs/by-name/va/vault/package.nix
@@ -0,0 +1,53 @@
+{ stdenv, lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests
+, makeWrapper
+, gawk
+, glibc
+}:
+
+buildGoModule rec {
+  pname = "vault";
+  version = "1.17.6";
+
+  src = fetchFromGitHub {
+    owner = "hashicorp";
+    repo = "vault";
+    rev = "v${version}";
+    hash = "sha256-sd4gNNJ/DVpl7ReymykNemWz4NNisofMIH6lLNl+iVw=";
+  };
+
+  vendorHash = "sha256-V7aMf03U2DTNg1murp4LBfuOioA+7iG6jX9o05rhM2U=";
+
+  proxyVendor = true;
+
+  subPackages = [ "." ];
+
+  nativeBuildInputs = [ installShellFiles makeWrapper ];
+
+  tags = [ "vault" ];
+
+  ldflags = [
+    "-s" "-w"
+    "-X github.com/hashicorp/vault/sdk/version.GitCommit=${src.rev}"
+    "-X github.com/hashicorp/vault/sdk/version.Version=${version}"
+    "-X github.com/hashicorp/vault/sdk/version.VersionPrerelease="
+  ];
+
+  postInstall = ''
+    echo "complete -C $out/bin/vault vault" > vault.bash
+    installShellCompletion vault.bash
+  '' + lib.optionalString stdenv.hostPlatform.isLinux ''
+    wrapProgram $out/bin/vault \
+      --prefix PATH ${lib.makeBinPath [ gawk glibc ]}
+  '';
+
+  passthru.tests = { inherit (nixosTests) vault vault-postgresql vault-dev vault-agent; };
+
+  meta = with lib; {
+    homepage = "https://www.vaultproject.io/";
+    description = "Tool for managing secrets";
+    changelog = "https://github.com/hashicorp/vault/blob/v${version}/CHANGELOG.md";
+    license = licenses.bsl11;
+    mainProgram = "vault";
+    maintainers = with maintainers; [ rushmorem lnl7 offline pradeepchhetri Chili-Man techknowlogick ];
+  };
+}