summaryrefslogtreecommitdiff
path: root/custom/luaPam.nix
blob: f0c93e4f5b9fcf3abd6775a40f7e531dc306efd1 (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.luaPackages.lua;
in pkgs.luaPackages.buildLuaPackage {
  name = "lua-pam";
  buildInputs = (with pkgs; [ pam ]);
  src = fetchgit {
    url = "https://github.com/devurandom/lua-pam";
    rev = "3818ee6346a976669d74a5cbc2a83ad2585c5953";
    sha256 = "1aci3psyxwxbls93w5b4vdhnrrp3w94i97dl8qrmjgigzbjszwvr";
  };
  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}/
  '';
}