depot/third_party/nixpkgs/pkgs/by-name/pi/piv-agent/package.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

41 lines
975 B
Nix

{ lib
, stdenv
, buildGoModule
, darwin
, fetchFromGitHub
, pcsclite
, pkg-config
}:
buildGoModule rec {
pname = "piv-agent";
version = "0.21.0";
src = fetchFromGitHub {
owner = "smlx";
repo = "piv-agent";
rev = "v${version}";
hash = "sha256-aukcnubhB8kbAl22eeFKzLPvVcYdgcEQ1gy3n6KWG00=";
};
vendorHash = "sha256-1d6EKEvo4XNDXRtbdnKkqyF9y0LPPHWKu9X/wYnbmas=";
subPackages = [ "cmd/piv-agent" ];
ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.shortCommit=${src.rev}" ];
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
buildInputs =
if stdenv.isDarwin
then [ darwin.apple_sdk.frameworks.PCSC ]
else [ pcsclite ];
meta = with lib; {
description = "An SSH and GPG agent which you can use with your PIV hardware security device (e.g. a Yubikey)";
homepage = "https://github.com/smlx/piv-agent";
license = licenses.asl20;
maintainers = [ ];
mainProgram = "piv-agent";
};
}