nixpkgs/pkgs/tools/security/solo2-cli/default.nix

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

52 lines
1.2 KiB
Nix
Raw Normal View History

2022-01-16 01:25:17 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, installShellFiles
, pkg-config
, pcsclite
, udev
, PCSC
, IOKit
, CoreFoundation
, AppKit
}:
rustPlatform.buildRustPackage rec {
pname = "solo2-cli";
2023-01-22 01:03:46 +00:00
version = "0.2.2";
2022-01-16 01:25:17 +00:00
src = fetchFromGitHub {
owner = "solokeys";
repo = pname;
rev = "v${version}";
2023-01-22 01:03:46 +00:00
sha256 = "sha256-7tpO5ir42mIKJXD0NJzEPXi/Xe6LdyEeBQWNfOdgX5I=";
2022-01-16 01:25:17 +00:00
};
2023-01-22 01:03:46 +00:00
cargoHash = "sha256-X+IEeztSL312Yq9Loi3cNJuVfSGk/tRRBCsy0Juji7Y=";
2022-01-16 01:25:17 +00:00
nativeBuildInputs = [ installShellFiles pkg-config ];
buildInputs = [ ]
++ lib.optionals stdenv.isLinux [ pcsclite udev ]
++ lib.optionals stdenv.isDarwin [ PCSC IOKit CoreFoundation AppKit ];
postInstall = ''
2022-02-16 21:18:32 +00:00
install -D 70-solo2.rules $out/lib/udev/rules.d/70-solo2.rules
2023-07-29 23:10:34 +00:00
installShellCompletion target/*/release/solo2.{bash,fish}
installShellCompletion --zsh target/*/release/_solo2
2022-01-16 01:25:17 +00:00
'';
doCheck = true;
buildFeatures = [ "cli" ];
meta = with lib; {
description = "A CLI tool for managing SoloKeys' Solo2 USB security keys.";
homepage = "https://github.com/solokeys/solo2-cli";
license = with licenses; [ asl20 mit ]; # either at your option
maintainers = with maintainers; [ lukegb ];
mainProgram = "solo2";
2022-01-16 01:25:17 +00:00
};
}