-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
pimsync: ensure local storage directories exist #8359
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
base: master
Are you sure you want to change the base?
Conversation
Unfortunately pipsync will throw an error if it trys to write into a nonexistant local storage directory. This patch ensures that all local storage directories are present for accounts with pimsync enabled.
|
havent had the time to upstream but instead of an activation script it is better to use tmpfiles (a systemd feature, you can check its usage in nixpkgs or hm). |
|
Thanks for the suggestion. I have implemented that change and it appears to be working on my system. |
|
cool. CI fails with evaluation errors from this code apparently. |
|
Looks like a bug in cc: @bmrips @dawidsowa |
The test environment stubs packages as |
|
@bmrips thanks for the explanation. With that fix, all tests pass on linux. However, |
| systemd.user.tmpfiles.rules = tmpFileRules; | ||
| systemd.user.tmpfiles.rules = lib.optionals ( | ||
| pkgs.stdenv.hostPlatform.system == lib.platforms.linux | ||
| ) tmpFileRules; |
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.
Using pkgs.stdenv.hostPlatform.isLinux is the idiomatic way.
For Darwin, you could still use the |
Description
Unfortunately pipsync will throw an error if it trys to write into a
nonexistant local storage directory. This patch ensures that all local
storage directories are present for accounts with pimsync enabled.
I have chosen to not gate this behind a config option since it is required in
order for pipsync to function correctly and it is a no op if the directories
already exist. But I could be convinced otherwise.
Also, I am a Nix newbie so feel free to critique my style or approach.
Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.Code tested through
nix run .#tests -- test-allornix-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.