2021-05-05 04:20:00 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, installShellFiles, python3, libxcb, AppKit, libiconv }:
|
2020-07-01 09:58:37 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "kbs2";
|
2021-10-22 07:42:25 +00:00
|
|
|
version = "0.4.0";
|
2020-07-01 09:58:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "woodruffw";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-10-22 07:42:25 +00:00
|
|
|
sha256 = "1bipphrzfz4dfzaqn1q60qazs7ylcx0b34gyl4q6d6jivsrhi8a4";
|
2020-07-01 09:58:37 +00:00
|
|
|
};
|
|
|
|
|
2021-10-22 07:42:25 +00:00
|
|
|
cargoSha256 = "0r254k85hqf2v8kdhwld8k7b350qjvkwfw2v22ikk2b41b2g4gbw";
|
2020-07-01 09:58:37 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ]
|
2021-01-15 09:19:50 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ python3 ];
|
2020-07-01 09:58:37 +00:00
|
|
|
|
|
|
|
buildInputs = [ ]
|
2021-01-15 09:19:50 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ libxcb ]
|
2021-05-05 04:20:00 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ AppKit libiconv ];
|
2020-07-01 09:58:37 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2020-12-06 04:20:00 +00:00
|
|
|
checkFlags = [ "--skip=kbs2::config::tests::test_find_config_dir" ]
|
2021-01-15 09:19:50 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ "--skip=test_ragelib_rewrap_keyfile" ];
|
2020-07-01 09:58:37 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-08-29 09:20:00 +00:00
|
|
|
mkdir -p $out/share/kbs2
|
|
|
|
cp -r contrib/ $out/share/kbs2
|
2020-07-01 09:58:37 +00:00
|
|
|
for shell in bash fish zsh; do
|
|
|
|
$out/bin/kbs2 --completions $shell > kbs2.$shell
|
|
|
|
installShellCompletion kbs2.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-07-01 09:58:37 +00:00
|
|
|
description = "A secret manager backed by age";
|
|
|
|
homepage = "https://github.com/woodruffw/kbs2";
|
2020-12-06 04:20:00 +00:00
|
|
|
changelog = "https://github.com/woodruffw/kbs2/blob/v${version}/CHANGELOG.md";
|
2020-07-01 09:58:37 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|