haccfiles/hosts/hainich/services/lantifa.nix

51 lines
1.5 KiB
Nix

{ config, lib, pkgs, ... }:
let
unstable = import (import ../../../nix/sources.nix).nixpkgs-unstable {};
in {
containers.lantifa = {
autoStart = true;
privateNetwork = true;
hostAddress6 = "fd00::42:14";
localAddress6 = "fd00::42:15";
config = {config, pkgs, ... }: {
networking.hosts."fd00::42:14" = [ "wiki.lantifa.org" ];
networking.firewall.allowedTCPPorts = [ 4422 ];
users.users.mediawiki.extraGroups = [ "keys" ];
services.mediawiki = {
enable = true;
name = "LANtifa";
package = unstable.mediawiki;
database.createLocally = true;
passwordFile = "/var/lib/mediawiki/mediawiki-password";
extraConfig = ''require_once('/var/lib/mediawiki/plugins/WikiDB/WikiDB.php');
$wgExtraNamespaces = array( 100 => "Table", 101 => "Table_Talk",);
$wgWikiDBNamespaces = 100;
$wgGroupPermissions['user']['writeapi'] = true;
$wgDefaultUserOptions['visualeditor-enable'] = 1;
'';
extensions = {
TemplateData = null;
VisualEditor = null;
InputBox = null;
};
virtualHost = {
hostName = "wiki.lantifa.org";
listen = [ { port = 4422; } ];
adminAddr = "admin@hacc.space";
};
};
};
};
services.nginx.virtualHosts."wiki.lantifa.org" = {
locations."/".proxyPass = "http://[" + config.containers.lantifa.localAddress6 + "]:4422";
forceSSL = true;
enableACME = true;
};
}