summary refs log tree commit diff
path: root/pkgs/os-specific/linux/google-authenticator/default.nix
blob: 7667b330f231e8fa1d7c6a4218a325a4c3f2bfd6 (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
{ stdenv, fetchurl, pam, qrencode }:

stdenv.mkDerivation rec {
  name = "google-authenticator-1.0";

  src = fetchurl {
    url = "https://google-authenticator.googlecode.com/files/libpam-${name}-source.tar.bz2";
    sha1 = "017b7d89989f1624e360abe02d6b27a6298d285d";
  };

  buildInputs = [ pam ];

  preConfigure = ''
    sed -i 's|libqrencode.so.3|${qrencode}/lib/libqrencode.so.3|' google-authenticator.c
  '';

  installPhase = ''
    mkdir -p $out/bin $out/lib/security
    cp pam_google_authenticator.so $out/lib/security
    cp google-authenticator $out/bin
  '';

  meta = {
    homepage = https://code.google.com/p/google-authenticator/;
    description = "Two-step verification, with pam module";
    license = "ASL2.0";
  };
}