Skip to content

Commit

Permalink
docs: add wordpress
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Feb 11, 2025
1 parent f8be0ed commit f88e4ac
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions docs/integrations/wordpress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Wordpress

```nix title="devenv.nix"
{ pkgs, config, ... }:
{
packages = with pkgs;[
git
wp-cli
];
languages.php.enable = true;
languages.php.package = pkgs.php82.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ redis pdo_mysql xdebug ];
extraConfig = ''
memory_limit = -1
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.idekey = vscode
xdebug.log_level = 0
max_execution_time = 0
'';
};
languages.php.fpm.pools.web = {
settings = {
"clear_env" = "no";
"pm" = "dynamic";
"pm.max_children" = 10;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 10;
};
};
certificates = [
"wp.localhost"
];
# This lets Caddy bind to 443
scripts.caddy-setcap.exec = ''
sudo setcap 'cap_net_bind_service=+ep' ${pkgs.caddy}/bin/caddy
'';
services.redis.enable = true;
# Links to MariaDB internally
services.mysql = {
enable = true;
settings.mysqld = {
max_allowed_packet = "512M";
};
};
services.mysql.initialDatabases = [{name = "wp"; }];
services.mysql.ensureUsers = [
{
name = "wordpress";
password = "YourSecretSauceHere";
ensurePermissions = { "wp.*" = "ALL PRIVILEGES"; };
}
];
services.caddy.enable = true;
services.caddy.virtualHosts."wp.localhost" = {
extraConfig = ''
tls ${config.env.DEVENV_STATE}/mkcert/wp.localhost.pem ${config.env.DEVENV_STATE}/mkcert/wp.localhost-key.pem
root * .
php_fastcgi unix/${config.languages.php.fpm.pools.web.socket}
file_server
'';
};
}
```

0 comments on commit f88e4ac

Please sign in to comment.