From 51b8484ffca2911ba8f89bdb06aa8d5c872f9f5d Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 10 Jul 2024 01:52:18 +0200 Subject: [PATCH] packages/openbao: init at 2.0.0-beta20240618 --- packages/projects.nix | 2 + packages/projects/openbao/default.nix | 53 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 packages/projects/openbao/default.nix diff --git a/packages/projects.nix b/packages/projects.nix index edc0767..9eb4f17 100644 --- a/packages/projects.nix +++ b/packages/projects.nix @@ -36,6 +36,8 @@ }; }; + openbao = pkgs.callPackage ./projects/openbao { }; + opentelemetry-java-agent-bin = pkgs.callPackage ./monitoring/opentelemetry-java-agent-bin { }; pin = pkgs.callPackage ./tools/pin { diff --git a/packages/projects/openbao/default.nix b/packages/projects/openbao/default.nix new file mode 100644 index 0000000..a4ced95 --- /dev/null +++ b/packages/projects/openbao/default.nix @@ -0,0 +1,53 @@ +{ stdenv, lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests +, makeWrapper +, gawk +, glibc +}: + +buildGoModule rec { + pname = "openbao"; + version = "2.0.0-beta20240618"; + + src = fetchFromGitHub { + owner = "openbao"; + repo = "openbao"; + rev = "v${version}"; + sha256 = "sha256-fvopKHLFMxDZUGg6BEWEEZwea6QO57Aa5JziKVulUqE="; + }; + + vendorHash = "sha256-Bm0PxFqEXL8G4D5oygb3aDzK7clv/KtKexFMpCnHlg8="; + + proxyVendor = true; + + subPackages = [ "." ]; + + nativeBuildInputs = [ installShellFiles makeWrapper ]; + + tags = [ "vault" ]; + + ldflags = [ + "-s" "-w" + "-X github.com/openbao/openbao/version.GitCommit=${src.rev}" + "-X github.com/openbao/openbao/version.Version=${version}" + "-X github.com/openbao/openbao/version.VersionPrerelease=" + ]; + + postInstall = '' + echo "complete -C $out/bin/openbao vault" > vault.bash + installShellCompletion vault.bash + '' + lib.optionalString stdenv.isLinux '' + wrapProgram $out/bin/openbao \ + --prefix PATH ${lib.makeBinPath [ gawk glibc ]} + ln -s openbao $out/bin/bao + ln -s openbao $out/bin/vault + ''; + + passthru.tests = { inherit (nixosTests) vault vault-postgresql vault-dev vault-agent; }; + + meta = with lib; { + homepage = "https://openbao.org/"; + description = "A tool for managing secrets"; + license = licenses.mpl20; + mainProgram = "vault"; + }; +} -- 2.47.0