2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, python3
|
|
|
|
, libxcb
|
|
|
|
, AppKit
|
|
|
|
, SystemConfiguration
|
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "kbs2";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "0.7.2";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "woodruffw";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-03-08 16:32:21 +00:00
|
|
|
hash = "sha256-o8/ENAWzVqs7rokST6xnyu9Q/pKqq/UnKWOFRuIuGes=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
cargoHash = "sha256-LcnvCWGVdBxhDgQDoGHXRppGeEpfjOv/F0dZMN2bOF8=";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ python3 ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
buildInputs = [ ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ libxcb ]
|
2023-03-04 12:14:45 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ SystemConfiguration AppKit ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
checkFlags = [ "--skip=kbs2::config::tests::test_find_config_dir" ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ "--skip=test_ragelib_rewrap_keyfile" ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
mkdir -p $out/share/kbs2
|
|
|
|
cp -r contrib/ $out/share/kbs2
|
2022-07-14 12:49:19 +00:00
|
|
|
installShellCompletion --cmd kbs2 \
|
|
|
|
--bash <($out/bin/kbs2 --completions bash) \
|
|
|
|
--fish <($out/bin/kbs2 --completions fish) \
|
|
|
|
--zsh <($out/bin/kbs2 --completions zsh)
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "A secret manager backed by age";
|
|
|
|
homepage = "https://github.com/woodruffw/kbs2";
|
2020-12-25 13:55:36 +00:00
|
|
|
changelog = "https://github.com/woodruffw/kbs2/blob/v${version}/CHANGELOG.md";
|
2020-07-18 16:06:22 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|