From e9199221ea2de41f52287b7541b41462c9c43ea5 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Mon, 9 Mar 2026 10:13:59 +0100 Subject: [PATCH 1/2] Enable native process manager in flake integration mode 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 --- src/modules/process-managers/native.nix | 15 +++++++++------ src/modules/processes.nix | 4 +++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/modules/process-managers/native.nix b/src/modules/process-managers/native.nix index 55292ab753..b95425c81e 100644 --- a/src/modules/process-managers/native.nix +++ b/src/modules/process-managers/native.nix @@ -193,13 +193,16 @@ in config.processes )); - # The actual process manager command will be invoked from devenv.rs - # We just need to provide the configuration via procfileScript + # In flake mode, the native process manager runs via devenv-tasks binary. + # The command backgrounds the process so procfileScript can manage it. process.manager.command = lib.mkDefault '' - # Native process manager is invoked directly from devenv up - # This script should not be reached - echo "Native process manager should be invoked from devenv up" >&2 - exit 1 + ${config.task.package}/bin/devenv-tasks run \ + --task-file ${config.task.config} \ + --mode all \ + --cache-dir ${lib.escapeShellArg config.devenv.dotfile} \ + --runtime-dir ${lib.escapeShellArg config.devenv.runtime} \ + ${lib.concatMapStringsSep " " (name: "devenv:processes:${name}") + (lib.attrNames (lib.filterAttrs (_: p: p.start.enable) config.processes))} & ''; }; } diff --git a/src/modules/processes.nix b/src/modules/processes.nix index 44ed328957..0557e99e51 100644 --- a/src/modules/processes.nix +++ b/src/modules/processes.nix @@ -349,8 +349,10 @@ in default = if config.devenv.cli.version != null && lib.versionAtLeast config.devenv.cli.version "2.0" then "native" + else if config.devenv.flakesIntegration + then "native" else "process-compose"; - defaultText = lib.literalMD "`native` for devenv 2.0+, `process-compose` otherwise"; + defaultText = lib.literalMD "`native` for devenv 2.0+ or flake integration, `process-compose` otherwise"; example = "process-compose"; }; From b8adc3583972bfa9371e16d104b40843e908621e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 10:04:03 +0000 Subject: [PATCH 2/2] Auto generate docs/src/reference/options.md --- docs/src/reference/options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/reference/options.md b/docs/src/reference/options.md index 46284dc7ea..7efe10f24c 100644 --- a/docs/src/reference/options.md +++ b/docs/src/reference/options.md @@ -25015,7 +25015,7 @@ one of “hivemind”, “honcho”, “mprocs”, “native”, “overmind”, *Default:* -` native ` for devenv 2.0+, ` process-compose ` otherwise +` native ` for devenv 2.0+ or flake integration, ` process-compose ` otherwise