diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index 2eadde36e16..41cf31e4473 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -6,7 +6,9 @@ let mainCfg = config.services.httpd; - httpd = pkgs.apacheHttpd.override { mpm = mainCfg.multiProcessingModule; }; + httpd = mainCfg.apacheHttpd; + + httpdConf = mainCfg.configFile; php = pkgs.php.override { apacheHttpd = httpd; }; @@ -280,7 +282,7 @@ let ''; - httpdConf = pkgs.writeText "httpd.conf" '' + confFile = pkgs.writeText "httpd.conf" '' ServerRoot ${httpd} @@ -403,10 +405,29 @@ in "; }; + apacheHttpd = mkOption { + default = pkgs.apacheHttpd.override { mpm = mainCfg.multiProcessingModule; }; + example = "pkgs.apacheHttpd_2_4"; + description = " + Overridable attribute of the Apache HTTP Server package to use. + "; + }; + + configFile = mkOption { + default = confFile; + example = ''pkgs.writeText "httpd.conf" "# my custom config file ...";''; + description = " + Overridable config file to use for Apache. By default, use the + file automatically generated by nixos. + "; + }; + extraConfig = mkOption { default = ""; description = " - These configuration lines will be passed verbatim to the apache config + These configuration lines will be appended to the Apache config + file. Note that this mechanism may not work when + is overridden. "; };