2021-07-28 17:30:21 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, buildGoModule, libnotify, makeWrapper, pcsclite, pkg-config, darwin }:
|
2020-07-09 21:18:24 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "yubikey-agent";
|
2021-07-28 17:30:21 +00:00
|
|
|
version = "0.1.5";
|
2020-07-09 21:18:24 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FiloSottile";
|
|
|
|
repo = pname;
|
2021-07-06 04:20:00 +00:00
|
|
|
rev = "v${version}";
|
2021-07-28 17:30:21 +00:00
|
|
|
sha256 = "14s61jgcmpqh70jz0krrai8xg0xqhwmillxkij50vbsagpxjssk6";
|
2020-07-09 21:18:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
lib.optional stdenv.isLinux (lib.getDev pcsclite)
|
|
|
|
++ lib.optional stdenv.isDarwin (darwin.apple_sdk.frameworks.PCSC);
|
|
|
|
|
2021-01-17 03:51:22 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper pkg-config ];
|
2020-07-09 21:18:24 +00:00
|
|
|
|
|
|
|
postPatch = lib.optionalString stdenv.isLinux ''
|
|
|
|
substituteInPlace main.go --replace 'notify-send' ${libnotify}/bin/notify-send
|
|
|
|
'';
|
|
|
|
|
2022-01-31 00:36:17 +00:00
|
|
|
vendorSha256 = "1v4ccn7ysh8ax1nkf1v9fcgsdnz6zjyh6j6ivyljyfvma1lmcrmk";
|
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 = [ "." ];
|
|
|
|
|
2021-07-28 17:30:21 +00:00
|
|
|
postInstall = lib.optionalString stdenv.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 = "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;
|
|
|
|
};
|
|
|
|
}
|