nixpkgs/pkgs/tools/security/kbs2/default.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2020-07-01 10:58:37 +01:00
{ stdenv, rustPlatform, fetchFromGitHub, installShellFiles, python3, libxcb, AppKit }:
rustPlatform.buildRustPackage rec {
pname = "kbs2";
2020-10-18 16:43:20 +01:00
version = "0.1.6";
2020-07-01 10:58:37 +01:00
src = fetchFromGitHub {
owner = "woodruffw";
repo = pname;
rev = "v${version}";
2020-10-18 16:43:20 +01:00
sha256 = "0n83d4zvy74rn38fqq84lm58l24c3r87m2di2sw4cdr1hkjg3nbl";
2020-07-01 10:58:37 +01:00
};
2020-10-18 16:43:20 +01:00
cargoSha256 = "0kafyljn3b87k5m0wdii0gfa4wj1yfys8jqx79inj82m0w1khprk";
2020-07-01 10:58:37 +01: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
'';
checkFlagsArray = [ "--skip=kbs2::config::tests::test_find_config_dir" ];
postInstall = ''
2020-08-29 10:20:00 +01:00
mkdir -p $out/share/kbs2
cp -r contrib/ $out/share/kbs2
2020-07-01 10:58:37 +01: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";
license = licenses.mit;
maintainers = [ maintainers.marsam ];
};
}