summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-09-30 22:05:26 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-09-30 22:05:26 +0200
commite58f7872ea9dafe383f0054efdca8535016e9541 (patch)
tree6320a9b8bc843282894b3d2c08228689a9a05e82
parent508e9c0abde67e42a7dffae4d19475439f774d6b (diff)
downloadnixos-e58f7872ea9dafe383f0054efdca8535016e9541.tar
nixos-e58f7872ea9dafe383f0054efdca8535016e9541.tar.gz
nixos-e58f7872ea9dafe383f0054efdca8535016e9541.tar.bz2
nixos-e58f7872ea9dafe383f0054efdca8535016e9541.tar.xz
nixos-e58f7872ea9dafe383f0054efdca8535016e9541.zip
alias auth in prosody
-rw-r--r--custom/luaSha2.nix21
-rw-r--r--custom/prosody-auth.nix4
-rw-r--r--ymir.nix5
3 files changed, 27 insertions, 3 deletions
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 @@
1{ stdenv
2, fetchurl
3, pkgs
4}:
5
6let
7 lua = pkgs.lua51Packages.lua;
8in pkgs.lua51Packages.buildLuaPackage {
9 name = "luaSha2";
10 src = fetchurl {
11 url = "https://sha2.googlecode.com/archive/02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee.tar.gz";
12 sha256 = "18v0pn10cs6133jzm80sj2aw0ycpls150k9p0gplagap6xhzp6j2";
13 };
14 buildPhase = ''
15 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
16 '';
17 installPhase = ''
18 mkdir -p $out/lib/lua/${lua.luaversion}
19 install sha2.so $out/lib/lua/${lua.luaversion}
20 '';
21}
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 {
7 name = "prosody-auth"; 7 name = "prosody-auth";
8 src = fetchgit { 8 src = fetchgit {
9 url = "git://git.yggdrasil.li/prosody_auth"; 9 url = "git://git.yggdrasil.li/prosody_auth";
10 rev = "803fda7486e358dc79fc26884b40f4d739559da2"; 10 rev = "2e597f5218aa163f5b5ea5cd645dd447bb47b295";
11 sha256 = "2355d69f3c5440ef1377344e8dd582214b2f5e832cf9a2ff906fc6bc862f1e79"; 11 sha256 = "83d06d98585b3e4ef70ea32eca0f7b44687b0a412b162d286b5406ac0c89078c";
12 }; 12 };
13 builder = builtins.toFile "builder.sh" '' 13 builder = builtins.toFile "builder.sh" ''
14 source $stdenv/setup 14 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 @@
3let 3let
4 luaPam = pkgs.callPackage ./custom/luaPam.nix {}; 4 luaPam = pkgs.callPackage ./custom/luaPam.nix {};
5 luaPosix = pkgs.callPackage ./custom/luaPosix.nix {}; 5 luaPosix = pkgs.callPackage ./custom/luaPosix.nix {};
6 luaSha2 = pkgs.callPackage ./custom/luaSha2.nix {};
6 prosodyAuth = pkgs.callPackage ./custom/prosody-auth.nix {}; 7 prosodyAuth = pkgs.callPackage ./custom/prosody-auth.nix {};
7in { 8in {
8 imports = 9 imports =
@@ -30,7 +31,7 @@ in {
30 inherit (pkgs.lua51Packages) luasocket luasec luaexpat luafilesystem luabitop luaevent luazlib; 31 inherit (pkgs.lua51Packages) luasocket luasec luaexpat luafilesystem luabitop luaevent luazlib;
31 lua5 = pkgs.lua5_1; 32 lua5 = pkgs.lua5_1;
32 extraModules = [prosodyAuth]; 33 extraModules = [prosodyAuth];
33 extraLibs = [luaPam luaPosix]; 34 extraLibs = [luaPam luaPosix luaSha2];
34 }); 35 });
35 }; 36 };
36 37
@@ -103,6 +104,8 @@ in {
103 ]; 104 ];
104 extraConfig = '' 105 extraConfig = ''
105 authentication="custom" 106 authentication="custom"
107 custom_alias_file="/etc/prosody/aliases"
108 custom_alias_secret_file="/etc/prosody/alias_secret"
106 ''; 109 '';
107 110
108 virtualHosts."xmpp.li" = { 111 virtualHosts."xmpp.li" = {