Skip to content

fix: make flake dev env vars respect per-worktree overrides#8374

Draft
centdix wants to merge 2 commits intomainfrom
audit-webmux-startup
Draft

fix: make flake dev env vars respect per-worktree overrides#8374
centdix wants to merge 2 commits intomainfrom
audit-webmux-startup

Conversation

@centdix
Copy link
Collaborator

@centdix centdix commented Mar 15, 2026

Summary

Webmux/workmux worktrees get per-worktree DATABASE_URL, REMOTE, and port assignments via .env.local. However, the Nix flake's devEnvVars hardcoded these as derivation attributes, which direnv (use flake) applied unconditionally — overwriting the correct worktree-specific values with the main worktree defaults.

Changes

  • Move DATABASE_URL, REMOTE, REMOTE_LSP from Nix attrs to a shellHook using ${VAR:-default} so they respect pre-existing values from webmux's runtime.env
  • Add shellHook = devShellHook to both default and full devShells
  • Update .envrc to source .env.local after use flake, so direnv picks up per-worktree overrides (needed because nix print-dev-env evaluates shellHook in a clean subshell)

Test plan

  • Main worktree (no .env.local): echo $DATABASE_URL still shows windmill default
  • Webmux worktree with .env.local: echo $DATABASE_URL shows worktree-specific DB, echo $REMOTE shows correct port
  • nix develop without direnv: defaults still apply

Generated with Claude Code

centdix and others added 2 commits March 13, 2026 12:10
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2644325
Status: ✅  Deploy successful!
Preview URL: https://24a3a3fc.windmill.pages.dev
Branch Preview URL: https://audit-webmux-startup.windmill.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant