diff --git a/src/modules/processes.nix b/src/modules/processes.nix index dcdbc9dea..b72b4a3a2 100644 --- a/src/modules/processes.nix +++ b/src/modules/processes.nix @@ -135,19 +135,18 @@ in mkdir -p "$DEVENV_STATE" fi + backgroundPID=$! + stop_up() { echo "Stopping processes..." - kill -TERM $(cat "$DEVENV_STATE/devenv.pid") - rm "$DEVENV_STATE/devenv.pid" - wait + kill -TERM $backgroundPID + wait $backgroundPID ${config.process.after} echo "Processes stopped." } trap stop_up SIGINT SIGTERM - echo $! > "$DEVENV_STATE/devenv.pid" - wait '';