summary refs log tree commit diff
path: root/pkgs/tools/security/pass/extensions/otp.nix
blob: 6d35c4aa8375c2da300af870ae62f2c16249e34f (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
{ stdenv, fetchFromGitHub, oathToolkit }:

stdenv.mkDerivation rec {
  name = "pass-otp-${version}";
  version = "1.1.1";

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

  buildInputs = [ oathToolkit ];

  dontBuild = true;

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

  installFlags = [ "PREFIX=$(out)" ];

  meta = with stdenv.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 ];
    platforms = platforms.unix;
  };
}