module(wp): nginx++ with modules

This commit is contained in:
Raito Bezarius 2021-11-22 22:34:31 +01:00
parent 63ed846f8f
commit 5ce1e11537

View file

@ -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
};