]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - pkgs/webapps/phpbb/default.nix
Add langs and exts to phpbb passthru
[perso/Immae/Config/Nix.git] / pkgs / webapps / phpbb / default.nix
CommitLineData
a8ef1adb
IB
1{ stdenv, fetchurl, callPackage
2, varDir ? "/var/lib/phpbb"
3}:
4let
5 allExts = {
6 alfredoramos.markdown = callPackage ./extensions/markdown.nix {};
7 davidiq.mailinglist = callPackage ./extensions/mailinglist.nix {};
8 dmzx.mchat = callPackage ./extensions/mchat.nix {};
9 empteintesduweb.monitoranswers = callPackage ./extensions/monitoranswers.nix {};
10 lr94.autosubscribe = callPackage ./extensions/autosubscribe.nix {};
11 phpbbmodders.adduser = callPackage ./extensions/adduser.nix {};
12 };
13 allLangs = {
14 fr = callPackage ./langs/fr.nix {};
15 };
16 toPassthru = pkg: {
8d884ad2 17 inherit allLangs allExts;
a8ef1adb
IB
18 withLangs = withLangs pkg;
19 withExts = withExts pkg;
20 };
21 withExts = pkg: toExts:
22 let
23 exts = toExts allExts;
24 toInstallExt = ext: "cp -r ${ext}/* $out/ext/";
25 newPhpBB = pkg.overrideAttrs(old: {
26 installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallExt exts);
27 passthru = toPassthru newPhpBB;
28 });
29 in newPhpBB;
30 withLangs = pkg: toLangs:
31 let
32 langs = toLangs allLangs;
33 toInstallLang = lang: "cp -r ${lang}/*/ $out";
34 newPhpBB = pkg.overrideAttrs(old: {
35 installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallLang langs);
36 passthru = toPassthru newPhpBB;
37 });
38 in newPhpBB;
39 phpBB = stdenv.mkDerivation rec {
40 pname = "phpBB";
41 version = "3.3.0";
42
43 src = fetchurl {
44 url = "https://download.phpbb.com/pub/release/3.3/${version}/${pname}-${version}.tar.bz2";
45 sha256 = "a6234ac9dcf9086c025ece29a0a235f997a92bb9a994eff0ddcf8917e841262f";
46 };
47
48 phases = [ "unpackPhase" "installPhase" ];
49
50 installPhase = ''
51 cp -a . $out
52 mkdir -p $out/vars
53 mv $out/{cache,files,store,config.php} $out/vars
54 ln -s ${varDir}/{cache,files,store,config.php} $out/
55 echo -e "core:\n allow_install_dir: true" >> $out/config/production/config.yml
56 '';
57
58 passthru = toPassthru phpBB;
59 };
60in
61 phpBB