Open lloeki opened 1 week ago
Turns out, this worked fine:
launchd.agents."colima.default" = {
command = "${pkgs.colima}/bin/colima start --foreground";
serviceConfig = {
Label = "com.colima.default";
RunAtLoad = true;
KeepAlive = true;
# not sure where to put these paths and not reference a hard-coded `$HOME`; `/var/log`?
StandardOutPath = "/Users/loic.nageleisen/.colima/default/daemon/launchd.stdout.log";
StandardErrorPath = "/Users/loic.nageleisen/.colima/default/daemon/launchd.stderr.log";
# not using launchd.agents.<name>.path because colima needs the system ones as well
EnvironmentVariables = {
PATH = "${pkgs.colima}/bin:${pkgs.docker}/bin:/usr/bin:/bin:/usr/sbin:/sbin";
};
};
};
$ darwin-rebuild switch
$ launchctl load -w /Library/LaunchAgents/com.colima.default.plist
$ launchctl print gui/$(id -u)/com.colima.default
$ colima status
Note that one may have some sandbox allowance popups the first time you access some directories from within the VM.
This would be nice to have:
colima
on macOSvirtualisation.docker.enable = true
: https://github.com/LnL7/nix-darwin/issues/112Note that there seems to be a potential issue with sandboxing: https://github.com/abiosoft/colima/issues/490
There's this one upstream which requests a way to have a
LaunchAgent
orLaunchDaemon
set up bycolima
but that would not be declarative: https://github.com/abiosoft/colima/issues/262