2022-05-18 14:49:53 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, buildGoModule, libnotify, pcsclite, pkg-config, darwin }:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "yubikey-agent";
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.1.6";
|
2020-08-20 17:08:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FiloSottile";
|
2022-06-16 17:23:12 +00:00
|
|
|
repo = "yubikey-agent";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-Knk1ipBOzjmjrS2OFUMuxi1TkyDcSYlVKezDWT//ERY=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
lib.optional stdenv.isLinux (lib.getDev pcsclite)
|
|
|
|
++ lib.optional stdenv.isDarwin (darwin.apple_sdk.frameworks.PCSC);
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
postPatch = lib.optionalString stdenv.isLinux ''
|
|
|
|
substituteInPlace main.go --replace 'notify-send' ${libnotify}/bin/notify-send
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-+IRPs3wm3EvIgfQRpzcVpo2JBaFQlyY/RI1G7XfVS84=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
postInstall = lib.optionalString stdenv.isLinux ''
|
2020-08-20 17:08:02 +00:00
|
|
|
mkdir -p $out/lib/systemd/user
|
2021-04-17 00:35:05 +00:00
|
|
|
substitute contrib/systemd/user/yubikey-agent.service $out/lib/systemd/user/yubikey-agent.service \
|
2020-08-20 17:08:02 +00:00
|
|
|
--replace 'ExecStart=yubikey-agent' "ExecStart=$out/bin/yubikey-agent"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A seamless ssh-agent for YubiKeys";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
homepage = "https://filippo.io/yubikey-agent";
|
|
|
|
maintainers = with lib.maintainers; [ philandstuff rawkode ];
|
|
|
|
platforms = platforms.darwin ++ platforms.linux;
|
|
|
|
};
|
|
|
|
}
|