summaryrefslogtreecommitdiff
path: root/custom/luaPam.nix
blob: 0072d70c858b1d75b56d99a67a5576a962d13e0e (plain)
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
{ stdenv
, pkgs
, fetchgit
}:

let
  lua = pkgs.lua51Packages.lua;
in pkgs.lua51Packages.buildLuaPackage {
  name = "lua-pam";
  buildInputs = (with pkgs; [ pam ]);
  src = fetchgit {
    url = "https://github.com/devurandom/lua-pam";
    rev = "3818ee6346a976669d74a5cbc2a83ad2585c5953";
    sha256 = "0f594k5h0vz0whiqiw1iqmj1a5kaym2h780rr7yky8ixcgk1jlv2";
  };
  preBuild = ''
    makeFlagsArray=(
    LUA_CPPFLAGS="-I${lua}/include -L${lua}/lib"
    LUA_LIBS="-L${lua}/lib -llua"
    );
  '';
  installPhase = ''
    mkdir -p $out/lib/lua/${lua.luaversion}
    install pam.so $out/lib/lua/${lua.luaversion}/
  '';
}