diff options
| author | GaƩtan Lepage <33058747+GaetanLepage@users.noreply.github.com> | 2025-04-22 21:43:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-22 21:43:01 +0200 |
| commit | 3484e62a8d71217be346fb326deb1f0c92ba4771 (patch) | |
| tree | 6a226eec98ba0f98144b414f5950deabae653c50 | |
| parent | [Backport release-24.11] php81Extensions.ctype: fix build (#400906) (diff) | |
| parent | [BACKPORT 24.11] openbao: init at 2.2.0 (diff) | |
| download | nixpkgs-3484e62a8d71217be346fb326deb1f0c92ba4771.tar.gz | |
[BACKPORT 24.11] openbao: init at 2.2.0 (#400764)
| -rw-r--r-- | pkgs/by-name/op/openbao/package.nix | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/pkgs/by-name/op/openbao/package.nix b/pkgs/by-name/op/openbao/package.nix new file mode 100644 index 000000000000..60901c40b4fd --- /dev/null +++ b/pkgs/by-name/op/openbao/package.nix @@ -0,0 +1,74 @@ +{ + lib, + fetchFromGitHub, + buildGo124Module, + testers, + openbao, + versionCheckHook, + nix-update-script, +}: + +buildGo124Module rec { + pname = "openbao"; + version = "2.2.0"; + + src = fetchFromGitHub { + owner = "openbao"; + repo = "openbao"; + tag = "v${version}"; + hash = "sha256-dDMOeAceMaSrF7P4JZ2MKy6zDa10LxCQKkKwu/Q3kOU="; + }; + + vendorHash = "sha256-zcMc63B/jTUykPfRKvea27xRxjOV+zytaxKOEQAUz1Q="; + + proxyVendor = true; + + subPackages = [ "." ]; + + tags = [ + "openbao" + "bao" + ]; + + ldflags = [ + "-s" + "-w" + "-X github.com/openbao/openbao/version.GitCommit=${src.rev}" + "-X github.com/openbao/openbao/version.fullVersion=${version}" + ]; + + postInstall = '' + mv $out/bin/openbao $out/bin/bao + ''; + + # TODO: Enable the NixOS tests after adding OpenBao as a NixOS service in an upcoming PR and + # adding NixOS tests + # + # passthru.tests = { inherit (nixosTests) vault vault-postgresql vault-dev vault-agent; }; + + passthru.tests.version = testers.testVersion { + package = openbao; + command = "HOME=$(mktemp -d) bao --version"; + version = "v${version}"; + }; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/bao"; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + homepage = "https://www.openbao.org/"; + description = "Open source, community-driven fork of Vault managed by the Linux Foundation"; + changelog = "https://github.com/openbao/openbao/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.mpl20; + mainProgram = "bao"; + maintainers = with lib.maintainers; [ ]; + }; +} |
