From 13a78012e64d3349a51011608c39e25b5f7f29a2 Mon Sep 17 00:00:00 2001 From: Robert Djubek Date: Tue, 24 Nov 2020 10:00:27 +0000 Subject: [PATCH] nixpkgs-fmt --- apache.nix | 114 ++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/apache.nix b/apache.nix index 2d413d8..00028a7 100644 --- a/apache.nix +++ b/apache.nix @@ -185,82 +185,82 @@ with lib; }; apacheConfigFile = pkgs.writeText fileName '' - ServerRoot ${httpd} + ServerRoot ${httpd} - ${optionalString version24 '' - DefaultRuntimeDir ${config.stateDir}/runtime - ''} + ${optionalString version24 '' + DefaultRuntimeDir ${config.stateDir}/runtime + ''} - PidFile ${config.runtimeDir}/apache.pid + PidFile ${config.runtimeDir}/apache.pid - ${optionalString (config.webserver.apache.multiProcessingModule != "prefork") '' - # mod_cgid requires this. - ScriptSock ${config.runtimeDir}/cgisock - ''} + ${optionalString (config.webserver.apache.multiProcessingModule != "prefork") '' + # mod_cgid requires this. + ScriptSock ${config.runtimeDir}/cgisock + ''} - - MaxClients ${toString config.webserver.apache.maxClients} - MaxRequestsPerChild ${toString config.webserver.apache.maxRequestsPerChild} - + + MaxClients ${toString config.webserver.apache.maxClients} + MaxRequestsPerChild ${toString config.webserver.apache.maxRequestsPerChild} + - Listen *:${toString config.proxyOptions.port} - #Listen unix:/var/run/nginx.sock + Listen *:${toString config.proxyOptions.port} + #Listen unix:/var/run/nginx.sock - User ${mkUniqueUser config.webserver.user} - Group ${mkUniqueGroup config.webserver.group} + User ${mkUniqueUser config.webserver.user} + Group ${mkUniqueGroup config.webserver.group} - ${let + ${let load = { name, path }: "LoadModule ${name}_module ${path}\n"; - allModules = [ ] - ++ map (name: { inherit name; path = "${httpd}/modules/mod_${name}.so"; }) apacheModules - ++ optional config.webserver.apache.enableMellon { name = "auth_mellon"; path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; } - ++ optional config.webserver.apache.enablePHP { name = "php${phpMajorVersion}"; path = "${php}/modules/libphp${phpMajorVersion}.so"; } - ++ extraForeignModules - ++ config.webserver.apache.extraModules; - in + allModules = [ ] + ++ map (name: { inherit name; path = "${httpd}/modules/mod_${name}.so"; }) apacheModules + ++ optional config.webserver.apache.enableMellon { name = "auth_mellon"; path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; } + ++ optional config.webserver.apache.enablePHP { name = "php${phpMajorVersion}"; path = "${php}/modules/libphp${phpMajorVersion}.so"; } + ++ extraForeignModules + ++ config.webserver.apache.extraModules; + in concatMapStrings load allModules - } + } - AddHandler type-map var + AddHandler type-map var - - ${apache.allDenied} - + + ${apache.allDenied} + - ${mimeConf} - ${loggingConf} - ${browserHacks} + ${mimeConf} + ${loggingConf} + ${browserHacks} - Include ${httpd}/conf/extra/httpd-default.conf - Include ${httpd}/conf/extra/httpd-autoindex.conf - Include ${httpd}/conf/extra/httpd-multilang-errordoc.conf - Include ${httpd}/conf/extra/httpd-languages.conf + Include ${httpd}/conf/extra/httpd-default.conf + Include ${httpd}/conf/extra/httpd-autoindex.conf + Include ${httpd}/conf/extra/httpd-multilang-errordoc.conf + Include ${httpd}/conf/extra/httpd-languages.conf - ${if config.webserver.apache.adminAddr != null then '' - ServerAdmin ${config.webserver.apache.adminAddr} - '' else ""} + ${if config.webserver.apache.adminAddr != null then '' + ServerAdmin ${config.webserver.apache.adminAddr} + '' else ""} - # Fascist default - deny access to everything. - - Options FollowSymLinks - AllowOverride None - ${apache.allDenied} - + # Fascist default - deny access to everything. + + Options FollowSymLinks + AllowOverride None + ${apache.allDenied} + - # But do allow access to files in the store so that we don't have - # to generate clauses for every generated file that we - # want to serve. - - ${apache.allGranted} - + # But do allow access to files in the store so that we don't have + # to generate clauses for every generated file that we + # want to serve. + + ${apache.allGranted} + - ServerName "${config.uniqueName}" + ServerName "${config.uniqueName}" - ${optionalString (robotsTxt != "") '' - Alias /robots.txt ${pkgs.writeText "robots.txt" robotsTxt} - ''} + ${optionalString (robotsTxt != "") '' + Alias /robots.txt ${pkgs.writeText "robots.txt" robotsTxt} + ''} - ${config.webserver.apache.extraConfig} + ${config.webserver.apache.extraConfig} ''; robotsTxt = config.webserver.apache.robotsEntries;