depot/third_party/nixpkgs/pkgs/tools/security/gopass/hibp.nix

43 lines
996 B
Nix
Raw Normal View History

{ lib
, makeWrapper
, buildGoModule
, fetchFromGitHub
, gopass
}:
buildGoModule rec {
pname = "gopass-hibp";
version = "1.15.11";
src = fetchFromGitHub {
owner = "gopasspw";
repo = "gopass-hibp";
rev = "v${version}";
hash = "sha256-2XhvUIa8RxQ6CAKPGpL8/rBiJSX/WsSGtIpaHLIBM1E=";
};
vendorHash = "sha256-i9PUqircNf+jz5gcr3rVIR4tD9/bkV2h6LiDFhjiLaw=";
subPackages = [ "." ];
nativeBuildInputs = [ makeWrapper ];
ldflags = [
"-s" "-w" "-X main.version=${version}" "-X main.commit=${src.rev}"
];
postFixup = ''
wrapProgram $out/bin/gopass-hibp \
--prefix PATH : "${lib.makeBinPath [ gopass ]}"
'';
meta = with lib; {
description = "Gopass haveibeenpwnd.com integration";
homepage = "https://github.com/gopasspw/gopass-hibp";
changelog = "https://github.com/gopasspw/gopass-hibp/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ sikmir ];
mainProgram = "gopass-hibp";
};
}