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

nixos/public-inbox: init #77450

Open
wants to merge 1 commit into
base: master
from
Open

nixos/public-inbox: init #77450

wants to merge 1 commit into from

Conversation

@alyssais
Copy link
Member

@alyssais alyssais commented Jan 10, 2020

Motivation for this change

I’ve been using this for months now, and it works great. And several other people have expressed interest in my module, so here it is. :)

This module encapsulates pretty much all of public-inbox's
functionality. While there are a lot of options, they're only exposed
for things that either I think have a high chance of being something a
large proportion of users need to set, or if the module needs to do
some special setup to accomodate them. All other public-inbox
configuration can be set through the `config' options.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cc @catern

{
options = {
services.public-inbox = {
enable = mkEnableOption "the public-inbox mail archiver";

This comment has been minimized.

@bjornfor

bjornfor Jan 12, 2020
Contributor

Can you add some more info, perhaps upstream URL? The name "public-inbox" is not search friendly, I don't know what this is 😊

This comment has been minimized.

@alyssais

alyssais Jan 12, 2020
Author Member

It isn’t? When I do a web search for public-inbox (using a non-bubbling search engine) the project’s README is literally the first result. https://public-inbox.org/README.html

This comment has been minimized.

@bjornfor

bjornfor Jan 13, 2020
Contributor

In my duck-duck-go search it is in 4th place. Google place it in 1st, and with a better title and text snippet. I think at least for duck-duck-go users it would help to make it obvious what this module is talking about.

This comment has been minimized.

@alyssais

alyssais Jan 13, 2020
Author Member

I have never seen a URL in a mkEnableOption, and just looked through 30 or so of them and didn’t see any there either. So I don’t think it makes sense to add one for this one module when we don’t do so elsewhere.

In Nixpkgs, package URLs go in the meta attribute for the package, and pkgs.public-inbox.meta.homepage is indeed set to the correct value.

@alyssais
Copy link
Member Author

@alyssais alyssais commented Jan 13, 2020

Note: public-inbox does not currently build on master. #77574 will fix this.

This module encapsulates pretty much all of public-inbox's
functionality.  While there are a lot of options, they're only exposed
for things that either I think have a high chance of being something a
large proportion of users need to set, or if the module needs to do
some special setup to accomodate them.  All other public-inbox
configuration can be set through the `config' options.
@alyssais alyssais force-pushed the alyssais:public-inbox branch from d2c6a33 to c9be0a3 Jan 27, 2020
@alyssais alyssais requested a review from Infinisil as a code owner Jan 27, 2020
@ju1m
Copy link
Contributor

@ju1m ju1m commented May 27, 2020

Great work @alyssais, thanks!

One remaining fix though, setting ˋmda.spamCheck == nullˋ does not work as expected because ˋpublicinboxmda.spamcheckˋ will be discarded by ˋconfigToListˋ. Note that in order to properly disable spamcheck in the final config, one has to set ˋpublicinboxmda.spamcheckˋ to something (eg. "none") to make public-inbox-mda work; it does not work to simply set the option to an empty string: public-inbox-mda still searches and fails to find ˋspamcˋ. (edit: it actually must be set to "none" in this case according to https://public-inbox.org/public-inbox-config.html )

Also, it would be great to expose ˋenvironmentˋ as a config option for people like me who want to use rspamd instead of spamassassin and may therefore prefer to pipe rspamc into public-inbox-mda from a script in a ˋservices.postfix.masterConfig.rspamdˋ. Instead of passing by the ˋ.forwardˋ. edit: well, all this would be needed only when rspamd is not used as a postfix milter, eg. to apply rspamd's check "per user" (milter is not yet dispatched to users), but this is a very advanced config and NixOS' default to using ˋsmtpd_milters = unix:/run/rspamd.sockˋ.

And it would be even greater to expose config options using the ˋsettingsˋ scheme of NixOS/rfcs#42 (as done for example in the ˋsanoidˋ module). What do you think?

@ju1m
Copy link
Contributor

@ju1m ju1m commented Jun 2, 2020

We should add something like install -D -p ${configFile} $out/.public-inbox/config in home to use admin command without setting PI_CONFIG, like: curl -L http://example.org/lists/archives/$name/$msgid/raw | sudo -u public-inbox public-inbox-learn rm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.