Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
55 lines
1.3 KiB
Nix
55 lines
1.3 KiB
Nix
{
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
lib,
|
|
libnitrokey,
|
|
rustPlatform,
|
|
stdenv,
|
|
}:
|
|
let
|
|
version = "0.4.1";
|
|
in
|
|
rustPlatform.buildRustPackage {
|
|
pname = "nitrocli";
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "d-e-s-o";
|
|
repo = "nitrocli";
|
|
tag = "v${version}";
|
|
hash = "sha256-j1gvh/CmRhPTeesMIK5FtaqUW7c8hN3ub+kQ2NM3dNM=";
|
|
};
|
|
|
|
cargoHash = "sha256-lWFleq9uxoshPMx2mYULCyEar72ZjGfgf0HlRoYfG/M=";
|
|
|
|
# tests require a connected Nitrokey device
|
|
doCheck = false;
|
|
|
|
# link against packaged libnitrokey
|
|
USE_SYSTEM_LIBNITROKEY = 1;
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
buildInputs = [ libnitrokey ];
|
|
|
|
postInstall =
|
|
(lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd nitrocli \
|
|
--bash <($out/bin/shell-complete bash nitrocli) \
|
|
--fish <($out/bin/shell-complete fish nitrocli) \
|
|
--zsh <($out/bin/shell-complete zsh nitrocli)
|
|
'')
|
|
+ ''
|
|
installManPage doc/nitrocli.1
|
|
rm $out/bin/shell-complete
|
|
'';
|
|
|
|
meta = {
|
|
description = "Command line tool for interacting with Nitrokey devices";
|
|
homepage = "https://github.com/d-e-s-o/nitrocli";
|
|
license = lib.licenses.gpl3Plus;
|
|
mainProgram = "nitrocli";
|
|
maintainers = with lib.maintainers; [ robinkrahl ];
|
|
};
|
|
}
|