syncthing: expand declarative config to Darwin #6104
+62
−31
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 PRs extends the recently merged PR #5616, which expanded the Synching config to allow declarative settings under Linux, such that it also works under Darwin.
To simplify the review process, I left split the PR into several commits for now:
syncthing
launchd agent to copy the synching key/certificate before starting syncthing, analogously to the systemd service from the above mentioned PR syncthing: expand declarative config #5616.syncthing-init
launchd agent (analogously to the systemd servicesynching-init
from the above mentioned PR syncthing: expand declarative config #5616) that updates the configuration files. Since this must be run after the syncthing service started, we use aWatchPath
to coordinate both launchd agents.format
tool.There might be better ways to coordinate the two launchd agents I'm not aware of. But I have had this running flawlessly for over two months now (on four Darwin and two Linux machines sharing various folders).
Fixes #4049 for Darwin systems.
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted (see commit 6; I'll squash the other commits into it after the review process)
Maintainer CC
@karaolidis (pinging as author of the original (linux-specific) PR #5616)
@rycee (maintainer)