nixpkgs/pkgs/tools/misc/yubikey-manager/default.nix

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

69 lines
1.6 KiB
Nix
Raw Normal View History

2023-08-08 07:41:06 +00:00
{ lib
, stdenv
, fetchFromGitHub
, python3Packages
, installShellFiles
, procps
}:
2017-03-19 09:16:22 +00:00
2019-01-17 21:17:12 +00:00
python3Packages.buildPythonPackage rec {
pname = "yubikey-manager";
2023-10-11 05:12:44 +00:00
version = "5.2.1";
format = "pyproject";
2017-03-19 09:16:22 +00:00
2021-07-30 22:57:28 +00:00
src = fetchFromGitHub {
owner = "Yubico";
2023-04-26 19:04:02 +00:00
repo = "yubikey-manager";
rev = version;
2023-10-11 05:12:44 +00:00
hash = "sha256-CUe/oB/+Hq9evnLwl8r0k5ObhI3vDt7oX79+20yMfjY=";
2017-03-19 09:16:22 +00:00
};
postPatch = ''
substituteInPlace "ykman/pcsc/__init__.py" \
--replace 'pkill' '${if stdenv.isLinux then "${procps}" else "/usr"}/bin/pkill'
'';
2023-08-08 07:41:06 +00:00
nativeBuildInputs = with python3Packages; [
poetry-core
pythonRelaxDepsHook
installShellFiles
];
2021-07-30 22:57:28 +00:00
2023-08-08 07:41:06 +00:00
propagatedBuildInputs = with python3Packages; [
cryptography
pyscard
fido2
click
keyring
];
2017-03-19 09:16:22 +00:00
2023-08-08 07:41:06 +00:00
pythonRelaxDeps = [
"keyring"
2017-03-19 09:16:22 +00:00
];
postInstall = ''
2023-08-08 07:41:06 +00:00
installManPage man/ykman.1
2023-08-08 07:41:06 +00:00
installShellCompletion --cmd ykman \
--bash <(_YKMAN_COMPLETE=bash_source "$out/bin/ykman") \
--zsh <(_YKMAN_COMPLETE=zsh_source "$out/bin/ykman") \
--fish <(_YKMAN_COMPLETE=fish_source "$out/bin/ykman") \
2017-03-19 09:16:22 +00:00
'';
2023-08-08 07:41:06 +00:00
nativeCheckInputs = with python3Packages; [
pytestCheckHook
makefun
];
2017-03-19 09:16:22 +00:00
meta = with lib; {
homepage = "https://developers.yubico.com/yubikey-manager";
2023-08-08 07:41:06 +00:00
changelog = "https://github.com/Yubico/yubikey-manager/releases/tag/${version}";
description = "Command line tool for configuring any YubiKey over all USB transports";
2017-03-19 09:16:22 +00:00
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = with maintainers; [ benley lassulus pinpox nickcao ];
mainProgram = "ykman";
2017-03-19 09:16:22 +00:00
};
}