2024-10-27 20:45:29 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, buildGoModule, installShellFiles, nixosTests
|
|
|
|
, makeWrapper
|
|
|
|
, gawk
|
|
|
|
, glibc
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "openbao";
|
2024-12-15 15:42:48 +00:00
|
|
|
version = "2.1.0";
|
2024-10-27 20:45:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openbao";
|
|
|
|
repo = "openbao";
|
|
|
|
rev = "v${version}";
|
2024-12-15 15:42:48 +00:00
|
|
|
hash = "sha256-QzUNb4T9uau9bWZX6ulUDyfdInGd86iClBAG72C+7mo=";
|
2024-10-27 20:45:29 +00:00
|
|
|
};
|
|
|
|
|
2024-12-15 15:42:48 +00:00
|
|
|
vendorHash = "sha256-ghy1gjo/bXoT+m8CGbWN4IXk4ywACR586UQf9F/azF8=";
|
2024-10-27 20:45:29 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
|
|
|
|
|
|
|
tags = [ "openbao" ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X github.com/openbao/openbao/sdk/version.GitCommit=${src.rev}"
|
|
|
|
"-X github.com/openbao/openbao/sdk/version.Version=${version}"
|
|
|
|
"-X github.com/openbao/openbao/sdk/version.VersionPrerelease="
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
echo "complete -C $out/bin/openbao openbao" > openbao.bash
|
|
|
|
installShellCompletion openbao.bash
|
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
|
|
|
wrapProgram $out/bin/openbao \
|
|
|
|
--prefix PATH ${lib.makeBinPath [ gawk glibc ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
# passthru.tests = { inherit (nixosTests) vault vault-postgresql vault-dev vault-agent; };
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://openbao.org/";
|
|
|
|
description = "Tool for managing secrets";
|
|
|
|
changelog = "https://github.com/openbao/openbao/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
mainProgram = "openbao";
|
|
|
|
maintainers = with maintainers; [ raitobezarius ];
|
|
|
|
};
|
|
|
|
}
|