Skip to content

Enable native process manager for flake integration users#2610

Open
mpscholten wants to merge 2 commits into
cachix:mainfrom
digitallyinduced:feat/native-process-manager-flakes
Open

Enable native process manager for flake integration users#2610
mpscholten wants to merge 2 commits into
cachix:mainfrom
digitallyinduced:feat/native-process-manager-flakes

Conversation

@mpscholten
Copy link
Copy Markdown
Contributor

@mpscholten mpscholten commented Mar 12, 2026

For ihp it would be nice to use the native process manager to stay close to the standard devenv experience. This patch makes it work.

What was the motivation on not supporting the native pm for flakes users?

Summary

  • Enables the native Rust process manager (devenv-tasks) when devenv is used via Nix flakes integration, not just via the devenv CLI 2.0+
  • Replaces the error stub in native.nix with a proper devenv-tasks run invocation
  • Adds flakesIntegration check to the process manager default in processes.nix

Depends on #2609

Problem

The native process manager doesn't work when devenv is integrated via Nix flakes because:

  1. cli.version is null in flake mode, so the process manager default falls through to "process-compose"
  2. native.nix had an error stub instead of a real command — it assumed the Rust CLI would invoke the process manager directly

This forces flake users to depend on process-compose even though the native manager is available and preferred.

Fix

processes.nix: Select "native" when config.devenv.flakesIntegration is true (in addition to the existing CLI 2.0+ check).

native.nix: Replace the error stub with a devenv-tasks run invocation that:

  • Passes --task-file, --mode all, --cache-dir, --runtime-dir
  • Lists all enabled process tasks as roots
  • Backgrounds the process so procfileScript can manage it

This works because TasksUi::run() already calls process_manager.run_foreground() when processes are still running after task completion — so devenv-tasks run naturally stays alive supervising processes.

cli.version is intentionally left as null to preserve the enterShell bash hook behavior (which depends on cli.version == null to run tasks via the devenv-tasks binary rather than the Rust CLI).

Test plan

  • devenv up in a flake-based project starts postgres and app processes via native manager
  • Ctrl+C gracefully shuts down all processes (with Fix: graceful process shutdown on Ctrl+C #2609)
  • devenv up restarts cleanly without stale PID files

🤖 Generated with Claude Code

The native Rust process manager didn't work when devenv was integrated
via Nix flakes because:

1. cli.version is null in flake mode, so the process manager default
   fell through to "process-compose"
2. native.nix had an error stub instead of a real command

Fix by:
- Adding flakesIntegration check to the process manager default in
  processes.nix, so native is selected for both CLI 2.0+ and flake mode
- Replacing the error stub in native.nix with a proper devenv-tasks run
  invocation that manages all enabled processes

This works because TasksUi::run() already calls
process_manager.run_foreground() when processes are still running after
task completion, so devenv-tasks run naturally stays alive supervising
processes.

cli.version is intentionally left as null to preserve the enterShell
bash hook behavior (which depends on cli.version == null to run tasks
via the devenv-tasks binary rather than the Rust CLI).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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