2020-07-18 16:06:22 +00:00
|
|
|
{ stdenv, rustPlatform, fetchFromGitHub, installShellFiles, python3, libxcb, AppKit }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "kbs2";
|
2020-12-25 13:55:36 +00:00
|
|
|
version = "0.2.5";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "woodruffw";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-12-25 13:55:36 +00:00
|
|
|
sha256 = "1jilsczz22fyqbgz43gl5ilz62gfqsahfk30gayj7q5bx9k35m4w";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
cargoSha256 = "1gvvmfavaq29p40p5mq1phpp2a1nw04dz4975pzm1b6z89p0jlzl";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ python3 ];
|
|
|
|
|
|
|
|
buildInputs = [ ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isLinux [ libxcb ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ AppKit ];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
checkFlags = [ "--skip=kbs2::config::tests::test_find_config_dir" ]
|
|
|
|
++ stdenv.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
|
2020-07-18 16:06:22 +00:00
|
|
|
for shell in bash fish zsh; do
|
|
|
|
$out/bin/kbs2 --completions $shell > kbs2.$shell
|
|
|
|
installShellCompletion kbs2.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|