make flake dev env vars respect per-worktree overrides (#8374)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
centdix
2026-03-16 15:12:52 +01:00
committed by GitHub
parent 54841b7549
commit 020de59fcf
2 changed files with 18 additions and 3 deletions

6
.envrc
View File

@@ -1 +1,7 @@
use flake
# Per-worktree overrides (ports, DATABASE_URL, etc.) written by webmux/workmux
# post-create hooks. Must come after `use flake` so they take precedence over
# the flake's defaults.
# shellcheck source=/dev/null
[ -f .env.local ] && source .env.local

View File

@@ -229,13 +229,20 @@
# ---------------------------------------------------------------
devEnvVars = {
DATABASE_URL = "postgres://postgres:changeme@127.0.0.1:5432/windmill?sslmode=disable";
REMOTE = "http://127.0.0.1:8000";
REMOTE_LSP = "http://127.0.0.1:3001";
NODE_ENV = "development";
NODE_OPTIONS = "--max-old-space-size=16384";
};
# Connection-specific defaults — set via shellHook so they respect
# pre-existing values (e.g. from webmux runtime.env / .env.local).
# Nix attrs are injected unconditionally and would override per-worktree
# values set by webmux before the interactive shell starts.
devShellHook = ''
export DATABASE_URL="''${DATABASE_URL:-postgres://postgres:changeme@127.0.0.1:5432/windmill?sslmode=disable}"
export REMOTE="''${REMOTE:-http://127.0.0.1:8000}"
export REMOTE_LSP="''${REMOTE_LSP:-http://127.0.0.1:3001}"
'';
# ---------------------------------------------------------------
# Helper scripts — base set (default + full)
# ---------------------------------------------------------------
@@ -402,6 +409,7 @@
# =============================================================
devShells.default = pkgs.mkShell (buildEnvVars // commonRuntimeVars // devEnvVars // browserVars // {
shellHook = devShellHook;
buildInputs = coreBuildInputs;
packages = helperScriptsBase ++ [ playwrightWrapper ];
@@ -413,6 +421,7 @@
# =============================================================
devShells.full = pkgs.mkShell (buildEnvVars // commonRuntimeVars // extraRuntimeVars // devEnvVars // browserVars // {
shellHook = devShellHook;
buildInputs = coreBuildInputs ++ extraRuntimes ++ (with pkgs; [
# Python extras
poetry