Skip to content

Commit

Permalink
nitrocli: init at 0.4.1 (#371166)
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored Jan 13, 2025
2 parents f6df08b + 68cf7ca commit 37a5b78
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions pkgs/by-name/ni/nitrocli/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
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-loCVYe4vdalo2AvoMo9th/V9xXulaq6HlPOw3idbqEw=";

# 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 ];
};
}

0 comments on commit 37a5b78

Please sign in to comment.