summary refs log tree commit diff
path: root/pkgs/tools/security/gen-oath-safe/default.nix
blob: 49770813b2b68cd03e0e3bb10e122cb1d8891a11 (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
34
35
36
37
38
39
40
41
{ coreutils, fetchFromGitHub, libcaca, makeWrapper, python, openssl, qrencode, stdenv, yubikey-manager }:

stdenv.mkDerivation {
  name = "gen-oath-safe-2017-01-23";
  src = fetchFromGitHub {
    owner = "mcepl";
    repo = "gen-oath-safe";
    rev = "fb53841";
    sha256 = "0018kqmhg0861r5xkbis2a1rx49gyn0dxcyj05wap5ms7zz69m0m";
  };

  buildInputs = [ makeWrapper ];

  buildPhase = ":";

  installPhase =
    let
      path = stdenv.lib.makeBinPath [
        coreutils
        libcaca.bin
        openssl.bin
        python
        qrencode
        yubikey-manager
      ];
    in
    ''
      mkdir -p $out/bin
      cp gen-oath-safe $out/bin/
      wrapProgram $out/bin/gen-oath-safe \
        --prefix PATH : ${path}
    '';
  meta = with stdenv.lib; {
    homepage = https://github.com/mcepl/gen-oath-safe;
    description = "Script for generating HOTP/TOTP keys (and QR code)";
    platforms =  platforms.unix;
    license = licenses.mit;
    maintainers = [ maintainers.makefu ];
  };

}