summaryrefslogtreecommitdiff
path: root/trivionomicon/modules/mediawiki/options.nix
blob: 06acbf17218dc47528a5b3f1053f1eefa8739b7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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;
      };'';
    };
  };
}