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