depot/third_party/nixpkgs/pkgs/tools/security/gopass/git-credential.nix

41 lines
895 B
Nix
Raw Normal View History

{ lib
, makeWrapper
, buildGoModule
, fetchFromGitHub
, gopass
}:
buildGoModule rec {
pname = "git-credential-gopass";
version = "1.15.2";
src = fetchFromGitHub {
owner = "gopasspw";
repo = pname;
rev = "v${version}";
hash = "sha256-HuqN/hl4weUr/PLyCE9dyrXADPHJW2XryQWWCMwgJ8k=";
};
vendorHash = "sha256-1pQ+f+m+cff6M0sfydaqGyvXqS6lyi9mfi9Pl4tynhU=";
subPackages = [ "." ];
nativeBuildInputs = [ makeWrapper ];
ldflags = [
"-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}"
];
postFixup = ''
wrapProgram $out/bin/git-credential-gopass \
--prefix PATH : "${lib.makeBinPath [ gopass ]}"
'';
meta = with lib; {
description = "Manage git credentials using gopass";
homepage = "https://github.com/gopasspw/git-credential-gopass";
license = licenses.mit;
maintainers = with maintainers; [ benneti ];
};
}