depot/third_party/nixpkgs/pkgs/tools/security/pass/extensions/otp.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

33 lines
881 B
Nix

{ lib, stdenv, fetchFromGitHub, oath-toolkit }:
stdenv.mkDerivation rec {
pname = "pass-otp";
version = "1.2.0";
src = fetchFromGitHub {
owner = "tadfisher";
repo = "pass-otp";
rev = "v${version}";
sha256 = "0cpqrf3939hcvwg7sd8055ghc8x964ilimlri16czzx188a9jx9v";
};
buildInputs = [ oath-toolkit ];
dontBuild = true;
patchPhase = ''
sed -i -e 's|OATH=\$(which oathtool)|OATH=${oath-toolkit}/bin/oathtool|' otp.bash
'';
installFlags = [ "PREFIX=$(out)"
"BASHCOMPDIR=$(out)/share/bash-completion/completions"
];
meta = with lib; {
description = "Pass extension for managing one-time-password (OTP) tokens";
homepage = "https://github.com/tadfisher/pass-otp";
license = licenses.gpl3;
maintainers = with maintainers; [ jwiegley tadfisher toonn ];
platforms = platforms.unix;
};
}