about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/pass/extensions/otp.nix
blob: 8d9b350543dc6ed83e44b47e819039ce5d9a6a58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, stdenv, fetchFromGitHub, oathToolkit }:

stdenv.mkDerivation rec {
  pname = "pass-otp";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "tadfisher";
    repo = "pass-otp";
    rev = "v${version}";
    sha256 = "0cpqrf3939hcvwg7sd8055ghc8x964ilimlri16czzx188a9jx9v";
  };

  buildInputs = [ oathToolkit ];

  dontBuild = true;

  patchPhase = ''
    sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
  '';

  installFlags = [ "PREFIX=$(out)"
                   "BASHCOMPDIR=$(out)/share/bash-completion/completions"
                 ];

  meta = with lib; {
    description = "A 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;
  };
}