Skip to content

feat(darwin): add Colima/Docker dev environment, fix GUI-app PATH - #679

Open
OscarMarshall wants to merge 2 commits into
mainfrom
claude/nix-darwin-docker-colima-e50aea
Open

feat(darwin): add Colima/Docker dev environment, fix GUI-app PATH#679
OscarMarshall wants to merge 2 commits into
mainfrom
claude/nix-darwin-docker-colima-e50aea

Conversation

@OscarMarshall

Copy link
Copy Markdown
Owner

Summary

  • Adds a declarative Docker/Colima dev environment for the Meraki Dashboard project's containerized Rails/RSpec workflow: Colima, Docker CLI, and Docker Compose installed via nixpkgs (no Homebrew), using home-manager's services.colima and programs.docker-cli modules so the VM settings, LaunchAgent, and active Docker context are all Nix-managed rather than requiring a one-time colima start/docker context use colima.
  • Fixes GUI-launched processes (anything opened from Spotlight/Dock, not a fish shell - e.g. Codex) never seeing Nix-installed packages: launchctl getenv PATH was empty on this Mac before this change. Fixed via nix-darwin's launchd.user.envVariables, applied to every host by default (den.schema.host.includes) since the gap affects every home-manager package, not just Docker tooling.
  • Wired into den.aspects.oscar.provides.work, so it only applies on scope.work machines (this Mac and dev203), and only actually materializes on Darwin - the hmDarwin/darwin classes are no-ops on the NixOS home node.

Details

Colima profile settings match the requested colima start --cpus 6 --memory 6 --disk 100 --vm-type vz --vz-rosetta --mount-type virtiofs --runtime docker exactly, generated declaratively as ~/.config/colima/default/colima.yaml. The profile runs as a per-user LaunchAgent (RunAtLoad + KeepAlive.SuccessfulExit), so it comes up at login and stays up - it does not restart on every darwin-rebuild switch, only when the generated LaunchAgent plist actually changes.

docker compose (the subcommand) needs no extra wiring - nixpkgs' docker package bundles compose/buildx as CLI plugins by default. docker-compose (the standalone binary Dashboard's script/spring still shells out to) comes from the separate docker-compose package.

No registry credentials or secrets are touched - Artifactory auth stays exactly as it is today, outside Nix.

Test plan

  • nix build .#darwinConfigurations.OMARSHAL-M-T2QF.config.system.build.toplevel succeeds
  • Inspected generated colima.yaml, the colima-default LaunchAgent plist, and ~/.docker/config.json (currentContext: colima) in the build output - all match the intended config
  • Confirmed config.launchd.user.envVariables.PATH is populated on the Darwin build
  • nix eval .#nixosConfigurations.harmony... / melaan... still evaluate cleanly with the new default-host include (the darwin-class content genuinely never reaches the NixOS option tree)
  • Not yet applied to the running system (darwin-rebuild switch) or verified against the actual Colima VM/docker info/GUI-app PATH on the live machine

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Meraki Dashboard's containerized Rails/RSpec dev environment needs Docker
locally; this adds it declaratively via nixpkgs (Colima, Docker CLI, Docker
Compose) instead of Homebrew, using home-manager's own colima/docker-cli
modules so the VM settings, LaunchAgent, and Docker context are all managed
by Nix rather than a one-time imperative `colima start`/`docker context use`.

Verifying this also surfaced that no GUI-launched process (anything opened
from Spotlight/Dock, not a fish shell) has ever seen Nix-installed packages
on this Mac - `launchctl getenv PATH` was empty. Fixed via nix-darwin's
`launchd.user.envVariables`, applied to every host by default rather than
scoped to this one aspect, since the gap affects every home-manager package,
not just Docker tooling.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 13, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a Nix-managed Colima/Docker development setup for Oscar’s work environment on Darwin, and introduces a default nix-darwin launchd PATH injection so GUI-launched apps inherit a usable PATH (including Nix profiles) instead of an empty one.

Changes:

  • Added a new my.colima aspect (hmDarwin) that installs Docker tooling and configures services.colima declaratively.
  • Wired my.colima into den.aspects.oscar.provides.work so it only applies on scope.work machines.
  • Added a default guiPath aspect that sets launchd.user.envVariables.PATH on Darwin hosts to fix GUI-app PATH inheritance.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
modules/aspects/users/oscar/work/work.nix Adds my.colima to Oscar’s work includes list.
modules/aspects/my/colima.nix Introduces a new hmDarwin aspect configuring Colima + Docker CLI/Compose tooling.
modules/aspects/defaults.nix Adds a Darwin-only default that sets launchd user PATH for GUI-launched apps.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread modules/aspects/defaults.nix
my.homebrew is enabled on OMARSHAL-M-T2QF, so GUI-launched apps need
/opt/homebrew/{bin,sbin} on PATH too, not just the Nix profile - otherwise
this fix only solves half the problem on this host.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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

Successfully merging this pull request may close these issues.

2 participants