summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/nixos.wiki/mediawiki.nix
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-06-19 03:25:39 +0200
committerlassulus <git@lassul.us>2023-06-19 03:25:39 +0200
commit139799c53cdaf55c362109e01be9dd96cc8700ed (patch)
treeb1ce719ec8f62458bce2d9fe2191b8d004630f2a /makefu/2configs/deployment/nixos.wiki/mediawiki.nix
parentcb8fbb09127392a17d698d91f78ede7ae46accb8 (diff)
parenta766e88e7c8d87aa6bdbde796d3a454f7b5e546e (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/deployment/nixos.wiki/mediawiki.nix')
-rw-r--r--makefu/2configs/deployment/nixos.wiki/mediawiki.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/nixos.wiki/mediawiki.nix b/makefu/2configs/deployment/nixos.wiki/mediawiki.nix
new file mode 100644
index 000000000..a346b82cb
--- /dev/null
+++ b/makefu/2configs/deployment/nixos.wiki/mediawiki.nix
@@ -0,0 +1,67 @@
+{ config, pkgs, ... }:
+
+let
+ hostAddress = "192.168.48.1";
+ localAddress = "192.168.48.3";
+in
+
+{
+ containers.mediawiki =
+ { autoStart = true;
+ privateNetwork = true;
+ inherit hostAddress localAddress;
+ config = { config, pkgs, ... }:
+ {
+ # NOTE: This disabling and importing is so that the basePath can be altered
+ disabledModules = [ "services/web-apps/mediawiki.nix" ];
+ imports = [
+ ./mediawiki.module.nix
+ ];
+ time.timeZone = "America/New_York";
+ system.stateVersion = "20.09";
+ networking.defaultGateway = hostAddress;
+ # NOTE: you might want to change this namserver address
+ networking.nameservers = [ "8.8.8.8" ];
+ networking.firewall.allowedTCPPorts = [ 80 ];
+ services.mediawiki = {
+ enable = true;
+ name = "Example Containerized Wiki";
+ # NOTE: here is where the basePath is specified, which requires the imported mediawiki NixOS module
+ basePath = "/wiki";
+ passwordFile = ./mediawiki.password.txt;
+ extraConfig = ''
+ $wgRCFeeds['euerkrebsco'] = array(
+ 'formatter' => 'JSONRCFeedFormatter',
+ 'uri' => 'udp://euer.krebsco.de:5005',
+ 'add_interwiki_prefix' => false,
+ 'omit_bots' => true,
+ );
+ $wgRCFeeds['euerkrebscoIRC'] = array(
+ 'formatter' => 'IRCColourfulRCFeedFormatter',
+ 'uri' => 'udp://euer.krebsco.de:5006',
+ 'add_interwiki_prefix' => false,
+ 'omit_bots' => true,
+ );
+ '';
+ virtualHost = {
+ hostName = "localhost";
+ adminAddr = "root@localhost";
+ forceSSL = false;
+ addSSL = false;
+ onlySSL = false;
+ enableACME = false;
+ };
+ };
+ };
+ };
+
+ # Put the MediaWiki web page behind an NGINX proxy
+ services.nginx = {
+ enable = true;
+ virtualHosts.localhost.locations."/wiki" = {
+ # NOTE: the slash at the end of the URI is important. It causes the location base path to be removed when passed onto the proxy
+ proxyPass = "http://${localAddress}:80/";
+ };
+ };
+
+}