about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/google-authenticator/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/google-authenticator/default.nix')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/google-authenticator/default.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/google-authenticator/default.nix b/nixpkgs/pkgs/os-specific/linux/google-authenticator/default.nix
new file mode 100644
index 000000000000..8ae5785eea8b
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/google-authenticator/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchurl, autoreconfHook, pam, qrencode }:
+
+stdenv.mkDerivation rec {
+  name = "google-authenticator-libpam-${version}";
+  version = "1.05";
+
+  src = fetchurl {
+    url = "https://github.com/google/google-authenticator-libpam/archive/${version}.tar.gz";
+    sha256 = "026vljmddi0zqcb3c0vdpabmi4r17kahc00mh6fs3qbyjbb14946";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ pam ];
+
+  preConfigure = ''
+    sed -i "s|libqrencode.so.4|${qrencode.out}/lib/libqrencode.so.4|" src/google-authenticator.c
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/lib/security
+    cp ./.libs/pam_google_authenticator.so $out/lib/security
+    cp google-authenticator $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = https://github.com/google/google-authenticator-libpam;
+    description = "Two-step verification, with pam module";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ aneeshusa ];
+    platforms = platforms.linux;
+  };
+}