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

nix: Add macOS launchd service to hm-module module #110

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

meck
Copy link
Contributor

@meck meck commented Apr 25, 2024

Home manager has the possibility to run macOS launchd services. These are automatically disabled when running on linux.

Home manager has the possibility to run macOS launchd services. These
are automatically disabled when running on linux.
@feschber
Copy link
Owner

Would be a good addition to have a launchd service definition in general. (#49)

Same as with the example config, I would prefer to have this in a central location (e.g. service/macos-launchd/lan-mouse.xml) and then referenced from the nix config.

I'm not to familiar with macos, so let me know if this could work.

@meck
Copy link
Contributor Author

meck commented Apr 26, 2024

Not quite sure, I'm not really a mac dev either. Pulling an externally defined launchd unit to nix would be complicated as it would need some editing wrt paths and so on. It's basically the same situation as the systemd unit that currently is defined in hm-module.nix separate from the one in service/lan-mouse.service

Regarding providing a general launchd unit outside of nix as a plain file there are some issues as well, the path to the executable needs to be absolute, so might need some editing. The canonical "mac" way would be to crate an app bundle (maybe (cargo-bundle)[https://github.com/burtonageo/cargo-bundle] could be used) and include the unit there and install at runtime.

@feschber
Copy link
Owner

Not quite sure, I'm not really a mac dev either. Pulling an externally defined launchd unit to nix would be complicated as it would need some editing wrt paths and so on. It's basically the same situation as the systemd unit that currently is defined in hm-module.nix separate from the one in service/lan-mouse.service

Regarding providing a general launchd unit outside of nix as a plain file there are some issues as well, the path to the executable needs to be absolute, so might need some editing. The canonical "mac" way would be to crate an app bundle (maybe (cargo-bundle)[https://github.com/burtonageo/cargo-bundle] could be used) and include the unit there and install at runtime.

Okay I see this is something that will go on the list then.

@feschber feschber merged commit 1e4312b into feschber:main Apr 28, 2024
7 checks passed
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.

None yet

2 participants