depot/third_party/nixpkgs/pkgs/tools/security/kbs2/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

57 lines
1.5 KiB
Nix

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, installShellFiles
, python3
, libxcb
, AppKit
, SystemConfiguration
}:
rustPlatform.buildRustPackage rec {
pname = "kbs2";
version = "0.7.2";
src = fetchFromGitHub {
owner = "woodruffw";
repo = pname;
rev = "v${version}";
hash = "sha256-o8/ENAWzVqs7rokST6xnyu9Q/pKqq/UnKWOFRuIuGes=";
};
cargoHash = "sha256-LcnvCWGVdBxhDgQDoGHXRppGeEpfjOv/F0dZMN2bOF8=";
nativeBuildInputs = [ installShellFiles ]
++ lib.optionals stdenv.hostPlatform.isLinux [ python3 ];
buildInputs = [ ]
++ lib.optionals stdenv.hostPlatform.isLinux [ libxcb ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ SystemConfiguration AppKit ];
preCheck = ''
export HOME=$TMPDIR
'';
checkFlags = [ "--skip=kbs2::config::tests::test_find_config_dir" ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ "--skip=test_ragelib_rewrap_keyfile" ];
postInstall = ''
mkdir -p $out/share/kbs2
cp -r contrib/ $out/share/kbs2
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kbs2 \
--bash <($out/bin/kbs2 --completions bash) \
--fish <($out/bin/kbs2 --completions fish) \
--zsh <($out/bin/kbs2 --completions zsh)
'';
meta = with lib; {
description = "Secret manager backed by age";
mainProgram = "kbs2";
homepage = "https://github.com/woodruffw/kbs2";
changelog = "https://github.com/woodruffw/kbs2/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = [ ];
};
}