-
Notifications
You must be signed in to change notification settings - Fork 35
darwin support #89
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
darwin support #89
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely didn't know the existence of Nix darwin! I'm really happy to see that comin could also be used to manage such systems 🎉
So, thank you very much to bring this contribution!
In the same idea, several people asked for the support of home-manager, so we can keep in mind this feature request while working on this patch: i'm pretty sure what we are doing here could be usefule for a home-manager support implementation.
A last thing is that i would like to first merge the MR #88 which is an important refactoring.
- Replace timeout-based restart with flag-based clean exit - Create restart flag when service config changes - Exit cleanly after deployment completes if flag exists - Let launchd handle automatic restart via KeepAlive - Prevents hanging during self-updates on Darwin
- Remove direct runtime.GOOS usage in utility functions - Add configurationAttr parameter propagated from initialization - Create separate deployDarwin and deployLinux functions - Simplify restart mechanism to just exit and let service manager restart - Add comprehensive tests for Darwin code paths - Require explicit hostname configuration (no fallbacks) - Update both NixOS and Darwin modules with hostname assertions
…x-darwin does not take care of kernel/macOS versions
|
Hey @nlewo sorry to keep you waiting, I just came back to address the issues you laid out. Hope this is better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments but lgtm!
|
I added a minor fix in the nix code and run go fmt. Thank you! |
|
Thank you! |
Add Darwin (macOS) support for comin
This PR adds full Darwin/macOS support to comin, allowing it to manage nix-darwin configurations in addition to NixOS systems.
What's Changed
Core Darwin Support
runtime.GOOSto switch between Linux and Darwin implementationslaunchctlinstead ofsystemctlsystem_profilerto get the Hardware UUIDdarwinConfigurationsalongside existingnixosConfigurationsDarwin Module
nix/darwin-module.nixthat providesdarwinModules.cominfor nix-darwin userslaunchd.daemonsinstead ofsystemd.servicesfor service managementDarwin-Specific Activation
activateandactivate-userscripts instead ofswitch-to-configurationService Restart Improvements
Path Fixes
/usr/sbin/system_profiler,/bin/launchctl, etc.) to work with launchd's restricted PATH environmentUsage
Darwin users can now add comin to their nix-darwin flake:
Testing
I've been running it on a couple of aarch64-darwin computers running one of the later macOS versions.