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

Closed
wants to merge 1 commit into from
Closed

Conversation

alyssais
Copy link
Member

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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.
@ju1m
Copy link
Contributor

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 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.

@stale
Copy link

stale bot commented Nov 30, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 30, 2020
@teto
Copy link
Member

teto commented Dec 21, 2020

closing in favor of #104457

@teto teto closed this Dec 21, 2020
@alyssais alyssais deleted the public-inbox branch April 16, 2021 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants