2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildGoModule
|
|
|
|
, darwin
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pcsclite
|
|
|
|
, pkg-config
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "piv-agent";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.21.2";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "smlx";
|
|
|
|
repo = "piv-agent";
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-nHxtQaQ5Lc0QAJrWU6fUWViDwOKkxVyj9/B6XZ+Y0zw=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
vendorHash = "sha256-L5HuTYA01w3LUtSy7OVxG6QN5uQZ8LVYyrBcJQTkIUA=";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/piv-agent" ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.shortCommit=${src.rev}" ];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
buildInputs =
|
2024-09-26 11:04:55 +00:00
|
|
|
if stdenv.hostPlatform.isDarwin
|
2024-04-21 15:54:59 +00:00
|
|
|
then [ darwin.apple_sdk.frameworks.PCSC ]
|
|
|
|
else [ pcsclite ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "SSH and GPG agent which you can use with your PIV hardware security device (e.g. a Yubikey)";
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://github.com/smlx/piv-agent";
|
|
|
|
license = licenses.asl20;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = [ ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "piv-agent";
|
|
|
|
};
|
|
|
|
}
|