add luadbi for db storage
parent
f254fad78a
commit
08914f047d
|
@ -0,0 +1,47 @@
|
|||
{lib, fetchurl, lua, sqlite, luaPackages,
|
||||
libpsql ? null, libmysql ? null,
|
||||
withpsql ? false, withmysql ? false}:
|
||||
|
||||
assert withpsql -> libpsql != null;
|
||||
assert withmysql -> libmysql != null;
|
||||
|
||||
luaPackages.buildLuaPackage rec {
|
||||
version = "0.5";
|
||||
name = "luadbi-${version}";
|
||||
isLibrary = true;
|
||||
src = fetchurl {
|
||||
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luadbi/luadbi.${version}.tar.gz";
|
||||
sha256 = "07ikxgxgfpimnwf7zrqwcwma83ss3wm2nzjxpwv2a1c0vmc684a9";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ sqlite ]
|
||||
++ (lib.optional withpsql [libpsql])
|
||||
++ (lib.optional withmysql [libmysql]);
|
||||
|
||||
unpackPhase = ''
|
||||
mkdir ./luadbi
|
||||
tar -xf $src -C ./luadbi
|
||||
sourceRoot=./luadbi
|
||||
chmod -R u+w "$sourceRoot";
|
||||
'';
|
||||
|
||||
preBuild = with lib.optionalString; ''
|
||||
makeFlagsArray=(
|
||||
sqlite3
|
||||
${lib.optionalString withpsql "psql"}
|
||||
${lib.optionalString withmysql "mysql"}
|
||||
LUA_LDIR="$out/share/lua/${lua.luaversion}"
|
||||
LUA_INC="-I${lua}/include" LUA_CDIR="$out/lib/lua/${lua.luaversion}"
|
||||
)
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/lua/${lua.luaversion}
|
||||
install -p ./*.so DBI.lua $out/lib/lua/${lua.luaversion}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://code.google.com/archive/p/luadbi/downloads";
|
||||
maintainers = [ "Yorick" ];
|
||||
};
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
let
|
||||
secrets = import <secrets>;
|
||||
yoricc = import ../packages/yori-cc.nix;
|
||||
luadbi = pkgs.callPackage ../packages/luadbi.nix {};
|
||||
acmeWebRoot = "/etc/sslcerts/acmeroot";
|
||||
acmeKeyDir = "${config.security.acme.directory}/yori.cc";
|
||||
in
|
||||
|
@ -123,10 +124,18 @@ in
|
|||
use_libevent = true
|
||||
s2s_require_encryption = true
|
||||
c2s_require_encryption = true
|
||||
archive_expires_after = "never"
|
||||
storage = {
|
||||
archive2 = "sql";
|
||||
}
|
||||
'';
|
||||
|
||||
admins = [ "yorick@yori.cc"];
|
||||
};
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
# FIXME: ugly hacks!
|
||||
{ prosody = pkgs.prosody.override { withZlib = true; luazlib = luadbi; };
|
||||
};
|
||||
systemd.services.prosody.serviceConfig.PermissionsStartOnly = true;
|
||||
systemd.services.prosody.preStart = ''
|
||||
mkdir -m 0700 -p /var/lib/prosody/keys
|
||||
|
|
Loading…
Reference in New Issue