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:
6
.envrc
6
.envrc
@@ -1 +1,7 @@
|
|||||||
use flake
|
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
|
||||||
|
|||||||
15
flake.nix
15
flake.nix
@@ -229,13 +229,20 @@
|
|||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
devEnvVars = {
|
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_ENV = "development";
|
||||||
NODE_OPTIONS = "--max-old-space-size=16384";
|
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)
|
# Helper scripts — base set (default + full)
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
@@ -402,6 +409,7 @@
|
|||||||
# =============================================================
|
# =============================================================
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell (buildEnvVars // commonRuntimeVars // devEnvVars // browserVars // {
|
devShells.default = pkgs.mkShell (buildEnvVars // commonRuntimeVars // devEnvVars // browserVars // {
|
||||||
|
shellHook = devShellHook;
|
||||||
buildInputs = coreBuildInputs;
|
buildInputs = coreBuildInputs;
|
||||||
|
|
||||||
packages = helperScriptsBase ++ [ playwrightWrapper ];
|
packages = helperScriptsBase ++ [ playwrightWrapper ];
|
||||||
@@ -413,6 +421,7 @@
|
|||||||
# =============================================================
|
# =============================================================
|
||||||
|
|
||||||
devShells.full = pkgs.mkShell (buildEnvVars // commonRuntimeVars // extraRuntimeVars // devEnvVars // browserVars // {
|
devShells.full = pkgs.mkShell (buildEnvVars // commonRuntimeVars // extraRuntimeVars // devEnvVars // browserVars // {
|
||||||
|
shellHook = devShellHook;
|
||||||
buildInputs = coreBuildInputs ++ extraRuntimes ++ (with pkgs; [
|
buildInputs = coreBuildInputs ++ extraRuntimes ++ (with pkgs; [
|
||||||
# Python extras
|
# Python extras
|
||||||
poetry
|
poetry
|
||||||
|
|||||||
Reference in New Issue
Block a user