summary refs log tree commit diff
path: root/pkgs/servers/web-apps
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2019-06-05 21:17:38 -0400
committerAaron Andersen <aaron@fosslib.net>2019-07-23 22:02:33 -0400
commite7178768481f88a63d0949098a204a3a0e599d80 (patch)
treee934d95d3875c3c0e74f3b5143cf2f459a4ec6fd /pkgs/servers/web-apps
parent72ef4786e160147660055787650b138fc2a69c40 (diff)
mediawiki: init at 1.32.2
Diffstat (limited to 'pkgs/servers/web-apps')
-rw-r--r--pkgs/servers/web-apps/mediawiki/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/servers/web-apps/mediawiki/default.nix b/pkgs/servers/web-apps/mediawiki/default.nix
new file mode 100644
index 0000000000000..e526afe661cf4
--- /dev/null
+++ b/pkgs/servers/web-apps/mediawiki/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, makeWrapper, writeText }:
+
+stdenv.mkDerivation rec {
+  pname = "mediawiki";
+  version = "1.33.0";
+
+  src = with stdenv.lib; fetchurl {
+    url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
+    sha256 = "0rydzmr64r3p5n6g8v9rifk277z1v31p82s8ka8xap8cfkca4dc3";
+  };
+
+  prePatch = ''
+    sed -i 's|$vars = Installer::getExistingLocalSettings();|$vars = null;|' includes/installer/CliInstaller.php
+  '';
+
+  phpConfig = writeText "LocalSettings.php" ''
+  <?php
+    return require(getenv('MEDIAWIKI_CONFIG'));
+  ?>
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/mediawiki
+    cp -r * $out/share/mediawiki
+    cp ${phpConfig} $out/share/mediawiki/LocalSettings.php
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "The collaborative editing software that runs Wikipedia";
+    license = licenses.gpl2Plus;
+    homepage = "https://www.mediawiki.org/";
+    platforms = platforms.all;
+    maintainers = [ maintainers.redvers ];
+  };
+}