haccfiles/hosts/hainich/services/lantifa.nix

58 lines
1.7 KiB
Nix
Raw Normal View History

2021-01-12 18:20:49 +00:00
{ config, lib, pkgs, ... }:
let
unstable = import (import ../../../nix/sources.nix).nixpkgs-unstable {};
in {
2021-01-12 18:20:49 +00:00
containers.lantifa = {
autoStart = true;
privateNetwork = true;
hostAddress6 = "fd00::42:14";
localAddress6 = "fd00::42:15";
config = {config, pkgs, ... }: {
2021-01-13 18:48:06 +00:00
networking.hosts."::1" = [ "wiki.lantifa.org" ];
networking.firewall.allowedTCPPorts = [ 80 ];
2021-01-12 18:20:49 +00:00
users.users.mediawiki.extraGroups = [ "keys" ];
services.mediawiki = {
enable = true;
name = "LANtifa";
package = unstable.mediawiki;
2021-01-12 18:20:49 +00:00
database.createLocally = true;
passwordFile = "/var/lib/mediawiki/mediawiki-password";
2021-01-13 18:48:06 +00:00
extraConfig = let
wikidb = pkgs.fetchzip {
url = "http://www.kennel17.co.uk/uploads/testwiki/e/e9/WikiDB.zip";
sha256 = "0d4f2ygglz4w515a7lgw59500q3xmr92xxhsmh8p204yaa769x8v";
};
in ''
require_once('${wikidb}/WikiDB.php');
2021-01-12 22:14:05 +00:00
$wgExtraNamespaces = array( 100 => "Table", 101 => "Table_Talk",);
$wgWikiDBNamespaces = 100;
$wgGroupPermissions['user']['writeapi'] = true;
$wgDefaultUserOptions['visualeditor-enable'] = 1;
2021-01-14 23:26:13 +00:00
$wgLogo = "/images/a/ac/LantifaLogoFem0.1.png";
2021-01-13 18:48:06 +00:00
'';
2021-01-12 22:14:05 +00:00
2021-01-13 18:48:06 +00:00
extensions = {
TemplateData = null;
VisualEditor = null;
InputBox = null;
2021-01-12 22:14:05 +00:00
};
2021-01-12 18:20:49 +00:00
virtualHost = {
hostName = "wiki.lantifa.org";
2021-01-13 18:48:06 +00:00
listen = [ { port = 80; } ];
2021-01-12 18:20:49 +00:00
adminAddr = "admin@hacc.space";
};
};
};
};
services.nginx.virtualHosts."wiki.lantifa.org" = {
2021-01-13 18:48:06 +00:00
locations."/".proxyPass = "http://[" + config.containers.lantifa.localAddress6 + "]";
forceSSL = true;
enableACME = true;
};
2021-01-12 18:20:49 +00:00
}