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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.3 KiB
Nix
Raw Normal View History

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