diff --git a/devenv.lock b/devenv.lock index 6d0c9cf..643fafc 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,11 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1784325378, - "narHash": "sha256-Gof6j4d43yX2qSLLp78JILke346IggDFIxTgl3ecVQE=", + "lastModified": 1787015266, + "narHash": "sha256-B4eXU1+QiZc3fFgH0pTl185xNUYNzW+1KIe9Jmtavkk=", "owner": "cachix", "repo": "devenv", - "rev": "5f1cf17be0fc48689bd0ecb810de6d2e06d259a1", + "rev": "c18de5253016e6eb97689724327f08e9dd2d4768", "type": "github" }, "original": { @@ -22,11 +22,11 @@ "nixpkgs-src": "nixpkgs-src" }, "locked": { - "lastModified": 1783345554, - "narHash": "sha256-LZhOm4kqjHUnwP4CNHpaqqEVcumGNd1PvOEOad8LkS0=", + "lastModified": 1787002832, + "narHash": "sha256-DGkHh88/7YLVGZ7HzSVN4YmUmR+wGKudIp6H9UsUNT0=", "owner": "cachix", "repo": "devenv-nixpkgs", - "rev": "6004ea8c229fe9d41b21c6f4c76bf6c2e10771dd", + "rev": "ee3d58d53cfcddfc0ae6fc7f04f4fe2a0c7cf0ed", "type": "github" }, "original": { @@ -39,11 +39,11 @@ "nixpkgs-src": { "flake": false, "locked": { - "lastModified": 1783279667, - "narHash": "sha256-/NAkDSsve+GNM0Bt6tleJdCGfsTlK89nPjkVOzZMo0s=", + "lastModified": 1786858016, + "narHash": "sha256-Vczr2zxD0orq6N2QQe5uqOGF7TRDcQJRRuAcsdHr4kg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f205b5574fd0cb7da5b702a2da51507b7f4fdd1b", + "rev": "54ba4bcec4043e72a4006d825e0d7aff5562008f", "type": "github" }, "original": { diff --git a/devenv.nix b/devenv.nix index 33faf76..a7ba381 100644 --- a/devenv.nix +++ b/devenv.nix @@ -38,6 +38,10 @@ alias ${config.env.DEVENV_ROOT}/themes/; } + location /mu-plugins/ { + alias ${config.env.DEVENV_ROOT}/mu-plugins/; + } + location ~ \.php$ { try_files $uri =404; include ${pkgs.nginx}/conf/fastcgi.conf; @@ -71,6 +75,8 @@ ]; }; + services.mailhog.enable = true; + services.mysql.enable = true; services.mysql.ensureUsers = [ { diff --git a/mu-plugins/mailhog.php b/mu-plugins/mailhog.php new file mode 100644 index 0000000..e0f4b57 --- /dev/null +++ b/mu-plugins/mailhog.php @@ -0,0 +1,21 @@ +isSMTP(); + $phpmailer->Host = '127.0.0.1'; + $phpmailer->Port = 1025; + $phpmailer->SMTPAuth = false; + $phpmailer->SMTPAutoTLS = false; + } +); + +// WordPress defaults the From address to "wordpress@localhost" in this +// environment, which PHPMailer rejects as invalid (no dot in the domain), +// causing wp_mail() to fail before it ever reaches mailhog. +add_filter( 'wp_mail_from', fn() => 'wordpress@wp-devenv.test' ); diff --git a/wp-config.php b/wp-config.php index ed2f607..1dc082a 100644 --- a/wp-config.php +++ b/wp-config.php @@ -10,6 +10,10 @@ define( 'WP_PLUGIN_DIR', __DIR__ . '/plugins' ); define( 'WP_PLUGIN_URL', 'http://localhost:8080/plugins' ); +// ** Must-use plugins also live in the repo root ** // +define( 'WPMU_PLUGIN_DIR', __DIR__ . '/mu-plugins' ); +define( 'WPMU_PLUGIN_URL', 'http://localhost:8080/mu-plugins' ); + // ** Database settings (matches services.mysql in devenv.nix) ** // define( 'DB_NAME', 'wp' ); define( 'DB_USER', 'wp' );