Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a colima module #1182

Open
lloeki opened this issue Nov 19, 2024 · 1 comment
Open

Add a colima module #1182

lloeki opened this issue Nov 19, 2024 · 1 comment

Comments

@lloeki
Copy link

lloeki commented Nov 19, 2024

This would be nice to have:

Note that there seems to be a potential issue with sandboxing: abiosoft/colima#490

There's this one upstream which requests a way to have a LaunchAgent or LaunchDaemon set up by colima but that would not be declarative: abiosoft/colima#262

@lloeki
Copy link
Author

lloeki commented Nov 19, 2024

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.

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

No branches or pull requests

1 participant