aboutsummaryrefslogtreecommitdiff
path: root/flakes/mypackages/pkgs/webapps/phpbb/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /flakes/mypackages/pkgs/webapps/phpbb/default.nix
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository
Diffstat (limited to 'flakes/mypackages/pkgs/webapps/phpbb/default.nix')
-rw-r--r--flakes/mypackages/pkgs/webapps/phpbb/default.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/flakes/mypackages/pkgs/webapps/phpbb/default.nix b/flakes/mypackages/pkgs/webapps/phpbb/default.nix
new file mode 100644
index 0000000..21ee154
--- /dev/null
+++ b/flakes/mypackages/pkgs/webapps/phpbb/default.nix
@@ -0,0 +1,61 @@
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: {
17 inherit allLangs allExts;
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