From 5ce1e115371fc9907030054f104eb32e0a4f928e Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 22 Nov 2021 22:34:31 +0100 Subject: [PATCH] module(wp): nginx++ with modules --- modules/web-apps/wordpress/module.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/web-apps/wordpress/module.nix b/modules/web-apps/wordpress/module.nix index 71d8296..0ea9cc4 100644 --- a/modules/web-apps/wordpress/module.nix +++ b/modules/web-apps/wordpress/module.nix @@ -14,7 +14,6 @@ let php = pkgs.php74; }; phpIni = php.phpIni; - enablePageSpeed = pkgs.stdenv.isLinux && appConfig.googlePageSpeed.enable; app = callPackage ./app.nix { inherit appConfig; writeable = { @@ -29,13 +28,23 @@ in { wpConfigSecrets = mkOption { type = types.str; }; + enablePageSpeed = mkOption { + type = types.bool; + default = pkgs.stdenv.isLinux && appConfig.googlePageSpeed.enable; + }; }; config = mkIf cfg.enable { environment.systemPackages = [ pkgs.wp-cli ]; services.nginx = { enable = true; - # package = pkgs.callPackage ./nginx.nix { inherit enablePageSpeed; }; + package = pkgs.nginx.override { + modules = with pkgs.nginxModules [ + dav + fastcgi-cache-purge + moreheaders + ] ++ optional cfg.enablePageSpeed pagespeed; + }; # httpConfig = nginxConfig; # TODO: ajouter les locations pour wordpress };