nixpkgs/pkgs/tools/security/kbs2/default.nix
2020-10-18 15:43:20 +00:00

45 lines
1.2 KiB
Nix

{ stdenv, rustPlatform, fetchFromGitHub, installShellFiles, python3, libxcb, AppKit }:
rustPlatform.buildRustPackage rec {
pname = "kbs2";
version = "0.1.6";
src = fetchFromGitHub {
owner = "woodruffw";
repo = pname;
rev = "v${version}";
sha256 = "0n83d4zvy74rn38fqq84lm58l24c3r87m2di2sw4cdr1hkjg3nbl";
};
cargoSha256 = "0kafyljn3b87k5m0wdii0gfa4wj1yfys8jqx79inj82m0w1khprk";
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 = ''
mkdir -p $out/share/kbs2
cp -r contrib/ $out/share/kbs2
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 ];
};
}