feat(darwin): add Colima/Docker dev environment, fix GUI-app PATH - #679
Open
OscarMarshall wants to merge 2 commits into
Open
feat(darwin): add Colima/Docker dev environment, fix GUI-app PATH#679OscarMarshall wants to merge 2 commits into
OscarMarshall wants to merge 2 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
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.colimaaspect (hmDarwin) that installs Docker tooling and configuresservices.colimadeclaratively. - Wired
my.colimaintoden.aspects.oscar.provides.workso it only applies onscope.workmachines. - Added a default
guiPathaspect that setslaunchd.user.envVariables.PATHon 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
services.colimaandprograms.docker-climodules so the VM settings, LaunchAgent, and active Docker context are all Nix-managed rather than requiring a one-timecolima start/docker context use colima.launchctl getenv PATHwas empty on this Mac before this change. Fixed via nix-darwin'slaunchd.user.envVariables, applied to every host by default (den.schema.host.includes) since the gap affects every home-manager package, not just Docker tooling.den.aspects.oscar.provides.work, so it only applies onscope.workmachines (this Mac anddev203), and only actually materializes on Darwin - thehmDarwin/darwinclasses 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 dockerexactly, 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 everydarwin-rebuild switch, only when the generated LaunchAgent plist actually changes.docker compose(the subcommand) needs no extra wiring - nixpkgs'dockerpackage bundles compose/buildx as CLI plugins by default.docker-compose(the standalone binary Dashboard'sscript/springstill shells out to) comes from the separatedocker-composepackage.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.toplevelsucceedscolima.yaml, thecolima-defaultLaunchAgent plist, and~/.docker/config.json(currentContext: colima) in the build output - all match the intended configconfig.launchd.user.envVariables.PATHis populated on the Darwin buildnix eval .#nixosConfigurations.harmony.../melaan...still evaluate cleanly with the new default-host include (thedarwin-class content genuinely never reaches the NixOS option tree)darwin-rebuild switch) or verified against the actual Colima VM/docker info/GUI-app PATH on the live machineCo-Authored-By: Claude Sonnet 5 noreply@anthropic.com