nixos/mediawiki: move virtualHost to httpd.virtualHost
This is a preparation to also allow nginx as a http server.
This commit is contained in:
parent
2362848adf
commit
1d2a96eda3
|
@ -73,7 +73,7 @@ let
|
||||||
$wgScriptPath = "";
|
$wgScriptPath = "";
|
||||||
|
|
||||||
## The protocol and server name to use in fully-qualified URLs
|
## The protocol and server name to use in fully-qualified URLs
|
||||||
$wgServer = "${if cfg.virtualHost.addSSL || cfg.virtualHost.forceSSL || cfg.virtualHost.onlySSL then "https" else "http"}://${cfg.virtualHost.hostName}";
|
$wgServer = "${if cfg.httpd.virtualHost.addSSL || cfg.httpd.virtualHost.forceSSL || cfg.httpd.virtualHost.onlySSL then "https" else "http"}://${cfg.httpd.virtualHost.hostName}";
|
||||||
|
|
||||||
## The URL path to static resources (images, scripts, etc.)
|
## The URL path to static resources (images, scripts, etc.)
|
||||||
$wgResourceBasePath = $wgScriptPath;
|
$wgResourceBasePath = $wgScriptPath;
|
||||||
|
@ -87,7 +87,7 @@ let
|
||||||
$wgEnableEmail = true;
|
$wgEnableEmail = true;
|
||||||
$wgEnableUserEmail = true; # UPO
|
$wgEnableUserEmail = true; # UPO
|
||||||
|
|
||||||
$wgEmergencyContact = "${if cfg.virtualHost.adminAddr != null then cfg.virtualHost.adminAddr else config.services.httpd.adminAddr}";
|
$wgEmergencyContact = "${if cfg.httpd.virtualHost.adminAddr != null then cfg.httpd.virtualHost.adminAddr else config.services.httpd.adminAddr}";
|
||||||
$wgPasswordSender = $wgEmergencyContact;
|
$wgPasswordSender = $wgEmergencyContact;
|
||||||
|
|
||||||
$wgEnotifUserTalk = false; # UPO
|
$wgEnotifUserTalk = false; # UPO
|
||||||
|
@ -318,7 +318,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualHost = mkOption {
|
httpd.virtualHost = mkOption {
|
||||||
type = types.submodule (import ../web-servers/apache-httpd/vhost-options.nix);
|
type = types.submodule (import ../web-servers/apache-httpd/vhost-options.nix);
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
{
|
{
|
||||||
|
@ -366,6 +366,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModule [ "services" "mediawiki" "virtualHost" ] [ "services" "mediawiki" "httpd" "virtualHost" ])
|
||||||
|
];
|
||||||
|
|
||||||
# implementation
|
# implementation
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
@ -421,7 +425,7 @@ in
|
||||||
services.httpd = {
|
services.httpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraModules = [ "proxy_fcgi" ];
|
extraModules = [ "proxy_fcgi" ];
|
||||||
virtualHosts.${cfg.virtualHost.hostName} = mkMerge [ cfg.virtualHost {
|
virtualHosts.${cfg.httpd.virtualHost.hostName} = mkMerge [ cfg.httpd.virtualHost {
|
||||||
documentRoot = mkForce "${pkg}/share/mediawiki";
|
documentRoot = mkForce "${pkg}/share/mediawiki";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
<Directory "${pkg}/share/mediawiki">
|
<Directory "${pkg}/share/mediawiki">
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
let
|
let
|
||||||
shared = {
|
shared = {
|
||||||
services.mediawiki.enable = true;
|
services.mediawiki.enable = true;
|
||||||
services.mediawiki.virtualHost.hostName = "localhost";
|
services.mediawiki.httpd.virtualHost.hostName = "localhost";
|
||||||
services.mediawiki.virtualHost.adminAddr = "root@example.com";
|
services.mediawiki.httpd.virtualHost.adminAddr = "root@example.com";
|
||||||
services.mediawiki.passwordFile = pkgs.writeText "password" "correcthorsebatterystaple";
|
services.mediawiki.passwordFile = pkgs.writeText "password" "correcthorsebatterystaple";
|
||||||
services.mediawiki.extensions = {
|
services.mediawiki.extensions = {
|
||||||
Matomo = pkgs.fetchzip {
|
Matomo = pkgs.fetchzip {
|
||||||
|
|
Loading…
Reference in a new issue