Remove platform check from the systemd module#2915
Merged
rycee merged 2 commits intonix-community:masterfrom Feb 7, 2023
Merged
Remove platform check from the systemd module#2915rycee merged 2 commits intonix-community:masterfrom
rycee merged 2 commits intonix-community:masterfrom
Conversation
berbiche
approved these changes
May 6, 2022
|
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting. If you are the original author of the PR
If you are not the original author of the PR
|
76faac1 to
8ac174c
Compare
7 tasks
Member
|
@midchildan would you be interested in rebasing the PR? @ncfavier @rycee I believe this PR is a decent QOL improvement |
8ac174c to
1f1e1e7
Compare
ncfavier
approved these changes
Feb 7, 2023
Contributor
Author
|
I rebased this PR and added an additional platform check to the |
Allow modules to define systemd services on macOS. It won't actually have any effect, but it would allow modules to define both systemd services and launchd agents without boilerplate conditionals. As a consequence of this change, each module would have to check for compatibility with the OS target instead.
1f1e1e7 to
edb3645
Compare
Member
|
Looks quite nice! 🙂 Merged to master now. |
7 tasks
7 tasks
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.
Description
This is related to #2497 (comment).
The systemd module currently contains checks to make sure user services aren't defined on Darwin hosts. But with launchd support now in HM, this can result in feature gating boilerplate when trying to create modules that supports both systemd and launchd.
After this change, modules would be able to define both systemd services and launchd agents without the boilerplate. The systemd module would just ignore them on macOS and vice versa for launchd. I'm hoping this wouldn't be a big issue because most consumers of the systemd module already checks if it supports the target OS. I've also added checks for those that didn't.
For a more concrete example, here's how a module supporting both systemd and launchd might look before this change:
And here's how it'd look after this change:
Checklist
Change is backwards compatible.
Code formatted with
./format.Code tested through
nix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Added myself as module maintainer. See example.
Added myself and the module files to
.github/CODEOWNERS.