This commit is contained in:
Gregor Lohaus
2026-08-18 15:30:44 +02:00
parent 5f9441441a
commit 80a333eb31
4 changed files with 40 additions and 9 deletions

View File

@@ -3,11 +3,11 @@
"devenv": { "devenv": {
"locked": { "locked": {
"dir": "src/modules", "dir": "src/modules",
"lastModified": 1784325378, "lastModified": 1787015266,
"narHash": "sha256-Gof6j4d43yX2qSLLp78JILke346IggDFIxTgl3ecVQE=", "narHash": "sha256-B4eXU1+QiZc3fFgH0pTl185xNUYNzW+1KIe9Jmtavkk=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv", "repo": "devenv",
"rev": "5f1cf17be0fc48689bd0ecb810de6d2e06d259a1", "rev": "c18de5253016e6eb97689724327f08e9dd2d4768",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -22,11 +22,11 @@
"nixpkgs-src": "nixpkgs-src" "nixpkgs-src": "nixpkgs-src"
}, },
"locked": { "locked": {
"lastModified": 1783345554, "lastModified": 1787002832,
"narHash": "sha256-LZhOm4kqjHUnwP4CNHpaqqEVcumGNd1PvOEOad8LkS0=", "narHash": "sha256-DGkHh88/7YLVGZ7HzSVN4YmUmR+wGKudIp6H9UsUNT0=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv-nixpkgs", "repo": "devenv-nixpkgs",
"rev": "6004ea8c229fe9d41b21c6f4c76bf6c2e10771dd", "rev": "ee3d58d53cfcddfc0ae6fc7f04f4fe2a0c7cf0ed",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -39,11 +39,11 @@
"nixpkgs-src": { "nixpkgs-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1783279667, "lastModified": 1786858016,
"narHash": "sha256-/NAkDSsve+GNM0Bt6tleJdCGfsTlK89nPjkVOzZMo0s=", "narHash": "sha256-Vczr2zxD0orq6N2QQe5uqOGF7TRDcQJRRuAcsdHr4kg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f205b5574fd0cb7da5b702a2da51507b7f4fdd1b", "rev": "54ba4bcec4043e72a4006d825e0d7aff5562008f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -38,6 +38,10 @@
alias ${config.env.DEVENV_ROOT}/themes/; alias ${config.env.DEVENV_ROOT}/themes/;
} }
location /mu-plugins/ {
alias ${config.env.DEVENV_ROOT}/mu-plugins/;
}
location ~ \.php$ { location ~ \.php$ {
try_files $uri =404; try_files $uri =404;
include ${pkgs.nginx}/conf/fastcgi.conf; include ${pkgs.nginx}/conf/fastcgi.conf;
@@ -71,6 +75,8 @@
]; ];
}; };
services.mailhog.enable = true;
services.mysql.enable = true; services.mysql.enable = true;
services.mysql.ensureUsers = [ services.mysql.ensureUsers = [
{ {

21
mu-plugins/mailhog.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
/**
* Route all outgoing mail through the local mailhog service (see devenv.nix)
* instead of actually sending it. View caught mail at http://localhost:8025.
*/
add_action(
'phpmailer_init',
function ( $phpmailer ) {
$phpmailer->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' );

View File

@@ -10,6 +10,10 @@
define( 'WP_PLUGIN_DIR', __DIR__ . '/plugins' ); define( 'WP_PLUGIN_DIR', __DIR__ . '/plugins' );
define( 'WP_PLUGIN_URL', 'http://localhost:8080/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) ** // // ** Database settings (matches services.mysql in devenv.nix) ** //
define( 'DB_NAME', 'wp' ); define( 'DB_NAME', 'wp' );
define( 'DB_USER', 'wp' ); define( 'DB_USER', 'wp' );