4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
47 lines
1.3 KiB
Nix
47 lines
1.3 KiB
Nix
{ lib, stdenv, rustPlatform, fetchFromGitHub, installShellFiles, python3, libxcb, AppKit }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "kbs2";
|
|
version = "0.2.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "woodruffw";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "1jilsczz22fyqbgz43gl5ilz62gfqsahfk30gayj7q5bx9k35m4w";
|
|
};
|
|
|
|
cargoSha256 = "1gvvmfavaq29p40p5mq1phpp2a1nw04dz4975pzm1b6z89p0jlzl";
|
|
|
|
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
|
|
'';
|
|
|
|
checkFlags = [ "--skip=kbs2::config::tests::test_find_config_dir" ]
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ "--skip=test_ragelib_rewrap_keyfile" ];
|
|
|
|
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 lib; {
|
|
description = "A secret manager backed by age";
|
|
homepage = "https://github.com/woodruffw/kbs2";
|
|
changelog = "https://github.com/woodruffw/kbs2/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.mit;
|
|
maintainers = [ maintainers.marsam ];
|
|
};
|
|
}
|