From e58f7872ea9dafe383f0054efdca8535016e9541 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 30 Sep 2015 22:05:26 +0200 Subject: alias auth in prosody --- custom/luaSha2.nix | 21 +++++++++++++++++++++ custom/prosody-auth.nix | 4 ++-- ymir.nix | 5 ++++- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 custom/luaSha2.nix diff --git a/custom/luaSha2.nix b/custom/luaSha2.nix new file mode 100644 index 00000000..d9b603f8 --- /dev/null +++ b/custom/luaSha2.nix @@ -0,0 +1,21 @@ +{ stdenv +, fetchurl +, pkgs +}: + +let + lua = pkgs.lua51Packages.lua; +in pkgs.lua51Packages.buildLuaPackage { + name = "luaSha2"; + src = fetchurl { + url = "https://sha2.googlecode.com/archive/02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee.tar.gz"; + sha256 = "18v0pn10cs6133jzm80sj2aw0ycpls150k9p0gplagap6xhzp6j2"; + }; + buildPhase = '' + gcc -L${lua}/lib -I$LUA_INC -I. sha2.c sha2lib.c -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN -llua -shared -o sha2.so + ''; + installPhase = '' + mkdir -p $out/lib/lua/${lua.luaversion} + install sha2.so $out/lib/lua/${lua.luaversion} + ''; +} diff --git a/custom/prosody-auth.nix b/custom/prosody-auth.nix index 0e88fe43..e12b2b06 100644 --- a/custom/prosody-auth.nix +++ b/custom/prosody-auth.nix @@ -7,8 +7,8 @@ in stdenv.mkDerivation { name = "prosody-auth"; src = fetchgit { url = "git://git.yggdrasil.li/prosody_auth"; - rev = "803fda7486e358dc79fc26884b40f4d739559da2"; - sha256 = "2355d69f3c5440ef1377344e8dd582214b2f5e832cf9a2ff906fc6bc862f1e79"; + rev = "2e597f5218aa163f5b5ea5cd645dd447bb47b295"; + sha256 = "83d06d98585b3e4ef70ea32eca0f7b44687b0a412b162d286b5406ac0c89078c"; }; builder = builtins.toFile "builder.sh" '' source $stdenv/setup diff --git a/ymir.nix b/ymir.nix index 09a0a965..c663c4ce 100644 --- a/ymir.nix +++ b/ymir.nix @@ -3,6 +3,7 @@ let luaPam = pkgs.callPackage ./custom/luaPam.nix {}; luaPosix = pkgs.callPackage ./custom/luaPosix.nix {}; + luaSha2 = pkgs.callPackage ./custom/luaSha2.nix {}; prosodyAuth = pkgs.callPackage ./custom/prosody-auth.nix {}; in { imports = @@ -30,7 +31,7 @@ in { inherit (pkgs.lua51Packages) luasocket luasec luaexpat luafilesystem luabitop luaevent luazlib; lua5 = pkgs.lua5_1; extraModules = [prosodyAuth]; - extraLibs = [luaPam luaPosix]; + extraLibs = [luaPam luaPosix luaSha2]; }); }; @@ -103,6 +104,8 @@ in { ]; extraConfig = '' authentication="custom" + custom_alias_file="/etc/prosody/aliases" + custom_alias_secret_file="/etc/prosody/alias_secret" ''; virtualHosts."xmpp.li" = { -- cgit v1.2.3