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
nixos/davmail: init #52096
nixos/davmail: init #52096
Conversation
bbcc0b9
to
ff4fa83
Compare
This pull request has been mentioned on Nix community. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review-december/1711/9 |
ff4fa83
to
447c4fe
Compare
@infinisil I don't have access to a setup where I can test this anymore. It may be another month or so before I'm able. |
I don't want to merge a PR untested. DynamicUser specifically enables some security related settings which might initially break things without the appropriate fixes. |
I'd like to have some more options. I've drafted this up and successfully tested the IMAP against my companies exchange server. Please consider my commit which is on top of the original: |
@aanderse I know everybody is doing this, but I'm really not a fan of making an arbitrary set of config values NixOS options. Instead see what I've done in #45470, that is, adding a single This has the advantages:
There are also a couple disadvantages, namely:
But I think the advantages outweigh the disadvantages. Please consider doing this instead, I'd really love to see it being used more in nixpkgs :) |
@infinisil Might as well go back to |
@infinisil The options I added are the bare minimum required to operate the service and nothing more (except extraConfig, of course). I've followed the conversations about reducing options which exist for no reason other than "because I can add them" and understand the problem. I've looked at some of the modules I have written and wish I understood these problems back then... but in this scenario I feel like all these options are justified. I'll take a look at your linked PR to analyze what you did, but I think that absolutely required options for a service to run should still be listed individually, no? |
@furrycatherder The problem with that is that you need to know the syntax of the file, and you can't set options in multiple NixOS modules and expect them to merge properly. Strings can only be concatenated together, whereas a Nix value can be merged nicely, which is invaluable for modularity. @aanderse But then you have the problems of: You can't detect when the user tries to override logFilePath in extraConfig, it will just be ignored or so. Such a Note that doing it this way doesn't in any way limit what default values you may set, you can just do In my opinion, NixOS options should ideally only be used for things that interact with other parts of NixOS. E.g. take a look at my murmur module. There's options |
To quote: #56423 (comment)
In regards to my experience with NixOS - at first I thought all the many configuration options in the module system was great. I've recently come to agree with the opinions of others that many of the options (such as stateDir, logDir, user, group, etc...) serve no real purpose or provide no value (and yes, at a cost). Debian doesn't offer any choice here and it has worked out great for them... why should we? This "replace all options with a config option set" is definitely a larger discussion that needs to happen. You have some great points. I'd like to hear from more people like you (ie. those much smarter than myself 😃 ) on both sides of the discussion and hopefully get some sort of consensus. Have you started an RFC by chance? As far as this PR goes... I'd really hate to see this PR get merged with the original configFile option because the beauty of the module system is that things generally "just work" with a minimal amount of configuration from the sysadmin. The configFile forces me to pkgs.writeText a bunch of stuff which is a big 👎, where the config option you suggested provides the bonus of "just works". @infinisil thanks for all the hard work you put in, and I appreciate you trying to show us a better way. |
Thanks, I haven't started an RFC yet, but I probably will at some point (soon?) @aanderse @furrycatherder I've rewritten this module to have such a |
@infinisil on irc we had discussed the idea of fewer options being better, but still having the ability to tweak if needed. The url is a required value (with no default) as noted in your code. If we saw config as that last resort a sysadmin had to take to tweak the app for some special use case then I still think url should be a NixOS option. Consider that as soon as you need to tweak config you need applicationt specific knowledge, you have to read documentation on the app you are configuring. We had discussed how NixOS is awesome because you don't need application specific knowledge, you just type services.foo.enable = true; and you're done. The thing that bothers me here is that in order to get the app working I need to tweak the config which means I need to read the manual. In the case of davmail only the url really jumps out at me as needing to be an option and documented in NixOS. Thoughts? |
@infinisil I've based a new commit on top of yours which puts url as a nixos option, but leaves the other options as you did. I think this strikes the right balance as Does this sit well with you? |
@aanderse Yeah I think that's great, I also thought maybe a NixOS option would be in order there. |
@furrycatherder how does aanderse@ca57881 sit with you then? Want to add that commit on top, squash them, and get this merged? I've already tested on my commit and everything is working. |
@aanderse It looks good, I have to manually cherry-pick your commit (d'oh) but I'll get it done today. Thanks for your help! And thanks @infinisil for the useful insight. |
@infinisil Should be ready for approval. |
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.
Looks good to me :D
You should squash all commits into a single one though
Co-authored-by: Aaron Andersen <aaron@fosslib.net> Co-authored-by: Silvan Mosberger <infinisil@icloud.com>
Motivation for this change
PR adds NixOS options for davmail, an IMAP/SMTP gateway server for MS Exchange.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)