From b3f43db171474132528be57610bfa5fb3b766879 Mon Sep 17 00:00:00 2001 From: Adam Poit Date: Tue, 10 Feb 2026 12:18:33 -0800 Subject: [PATCH] colima: fix KeepAlive to prevent process accumulation on macOS Change KeepAlive from boolean true to SuccessfulExit dictionary in the LaunchAgent configuration. When colima fails to start (e.g., disk already attached), the boolean true setting causes launchd to immediately restart it, spawning orphaned limactl usernet processes with each restart. Using SuccessfulExit = true ensures the service only restarts on clean exits (exit code 0), preventing the aggressive restart loop that accumulates orphaned processes. --- modules/services/colima.nix | 4 +++- tests/modules/services/colima/darwin/expected-agent.plist | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/services/colima.nix b/modules/services/colima.nix index 3855895f..988c3ada 100644 --- a/modules/services/colima.nix +++ b/modules/services/colima.nix @@ -202,7 +202,9 @@ in "--activate=${if profile.isActive then "true" else "false"}" "--save-config=false" ]; - KeepAlive = true; + KeepAlive = { + SuccessfulExit = true; + }; RunAtLoad = true; EnvironmentVariables.PATH = lib.makeBinPath [ cfg.package diff --git a/tests/modules/services/colima/darwin/expected-agent.plist b/tests/modules/services/colima/darwin/expected-agent.plist index 6a73e56c..9a1f4b94 100644 --- a/tests/modules/services/colima/darwin/expected-agent.plist +++ b/tests/modules/services/colima/darwin/expected-agent.plist @@ -8,7 +8,10 @@ @colima@/bin:@perl@/bin:@docker@/bin:@openssh@/bin:@coreutils@/bin:@curl@/bin:@bashNonInteractive@/bin:@DarwinTools@/bin KeepAlive - + + SuccessfulExit + + Label org.nix-community.home.colima-default ProgramArguments