summaryrefslogtreecommitdiff
path: root/modules/mediawiki/options.nix
diff options
context:
space:
mode:
authorFabian Montero <fabian@posixlycorrect.com>2026-02-03 14:46:33 -0600
committerFabian Montero <fabian@posixlycorrect.com>2026-02-03 15:10:47 -0600
commite44c6337d4557c9377b562e3687d24ef5e236974 (patch)
treebb7c4484c8f67423bc0cb6b5d8d0019278a74e64 /modules/mediawiki/options.nix
parentd7059ab8888ca605bc6a1f5822a070ef8c33b4a4 (diff)
modularize media wiki
Diffstat (limited to 'modules/mediawiki/options.nix')
-rw-r--r--modules/mediawiki/options.nix72
1 files changed, 72 insertions, 0 deletions
diff --git a/modules/mediawiki/options.nix b/modules/mediawiki/options.nix
new file mode 100644
index 0000000..06acbf1
--- /dev/null
+++ b/modules/mediawiki/options.nix
@@ -0,0 +1,72 @@
+{lib, ...}:
+with lib.types; {
+ sys = {
+ hostName = lib.mkOption {
+ type = str;
+ description = "used for nginx virtualhost. no protocol";
+ example = "wiki.posixlycorrect.com";
+ };
+
+ name = lib.mkOption {
+ type = str;
+ description = "name of the wiki";
+ example = "posixlycorrect wiki";
+ };
+
+ passwordFile = lib.mkOption {
+ type = types.path;
+ description = "path of passwordfile for mediawiki";
+ example = "/run/keys/mediawiki-password";
+ };
+
+ skins = lib.mkOption {
+ type = types.attrsOf (types.nullOr str);
+ description = "skins for mediawiki";
+ example = ''{
+ citizen = "flakes.mediawikiSkinCitizen";
+ };'';
+ };
+
+ extraConfig = lib.mkOption {
+ type = str;
+ example = ''
+ # Disable anonymous editing and account creation
+ $wgGroupPermissions['*']['edit'] = false;
+ $wgGroupPermissions['*']['createaccount'] = false;
+
+ $wgCitizenThemeDefault = 'dark';
+ $wgCitizenShowPageTools = 'login';
+ $wgLogos = [
+ 'icon' => "https://example.com/favicon.png",
+ '1x' => "https://example.com/favicon.png",
+ '2x' => "https://example.com/favicon.png",
+ ];
+
+ $wgEnableEmail = false; #TODO: arreglar esto
+ $wgNoReplyAddress = 'mediawiki@example.com';
+ $wgEmergencyContact = 'mediawiki@example.com';
+ $wgPasswordSender = 'mediawiki@example.com';
+ '';
+ };
+
+ extensions = lib.mkOption {
+ type = types.attrsOf (types.nullOr types.path);
+ description = "some extensions are included and can enabled by passing null";
+ example = ''{
+ VisualEditor = null;
+ CategoryTree = null;
+ CiteThisPage = null;
+ Scribunto = null;
+ Cite = null;
+ CodeEditor = null;
+ Math = null;
+ MultimediaViewer = null;
+ PdfHandler = null;
+ Poem = null;
+ SecureLinkFixer = null;
+ WikiEditor = null;
+ ParserFunctions = null;
+ };'';
+ };
+ };
+}