Commit graph

301 commits

Author SHA1 Message Date
Elis Hirwing 27b9b7b3af
Merge pull request #85026 from talyz/php_buildenv_override
php.buildEnv: Make the exported php package overridable, improve handling of currently enabled extensions, etc
2020-04-29 19:57:37 +02:00
Dominik Xaver Hörl c10d82358f treewide: add types to boolean / enable options or make use of mkEnableOption 2020-04-27 09:32:01 +02:00
talyz 2ba7926959
php.buildEnv: Provide a list of currently enabled extensions
Rework withExtensions / buildEnv to handle currently enabled
extensions better and make them compatible with override. They now
accept a function with the named arguments enabled and all, where
enabled is a list of currently enabled extensions and all is the set
of all extensions. This gives us several nice properties:

 - You always get the right version of the list of currently enabled
   extensions

 - Invocations chain

 - It works well with overridden PHP packages - you always get the
   correct versions of extensions

As a contrived example of what's possible, you can add ImageMagick,
then override the version and disable fpm, then disable cgi, and
lastly remove the zip extension like this:

{ pkgs ? (import <nixpkgs>) {} }:
with pkgs;

let
  phpWithImagick = php74.withExtensions ({ all, enabled }: enabled ++ [ all.imagick ]);

  phpWithImagickWithoutFpm743 = phpWithImagick.override {
    version = "7.4.3";
    sha256 = "wVF7pJV4+y3MZMc6Ptx21PxQfEp6xjmYFYTMfTtMbRQ=";
    fpmSupport = false;
  };

  phpWithImagickWithoutFpmZip743 = phpWithImagickWithoutFpm743.withExtensions (
    { enabled, all }:
      lib.filter (e: e != all.zip) enabled);

  phpWithImagickWithoutFpmZipCgi743 = phpWithImagickWithoutFpmZip743.override {
    cgiSupport = false;
  };
in
  phpWithImagickWithoutFpmZipCgi743
2020-04-26 16:43:05 +02:00
Dominik Xaver Hörl 0412bde942 treewide: add bool type to enable options, or make use of mkEnableOption
Add missing type information to manually specified enable options or replace them by mkEnableOption where appropriate.
2020-04-21 08:55:36 +02:00
Alyssa Ross 1b0d8015fe nixos/rss2email: globally install rss2email
For man pages.
2020-04-18 14:16:00 +00:00
Symphorien Gibol 9e417bc9e3 roundcube: use pspell for spellchecking
By default, upstream enables a third party service in the cloud:
https://github.com/roundcube/roundcubemail/blob/1.4.3/config/defaults.inc.php#L790-L798
2020-04-10 12:00:00 +00:00
Martin Milata fdc36e2c89 nixos/sympa: fix outgoing messaging
Because ProtectKernelModules implies NoNewPrivileges, postfix's sendmail
executable, which is setgid, wasn't able to send mail.
2020-03-24 02:35:39 +01:00
Martin Milata 8f632b404f sympa: build with --enable-fhs
Update module accordingly.
2020-03-24 02:32:22 +01:00
Léo Gaspard 693d834c37
Merge pull request #76739 from symphorien/mail_plugins
nixos/dovecot: add an option to enable mail_plugins
2020-03-12 22:44:23 +01:00
Benjamin Staffin 3a2790c342 services.mailman: RemainAfterExit so settings take effect properly
Prior to this fix, changes to certain settings would not be applied
automatically and users would have to know to manually restart the
affected service.  A prime example of this is
`services.mailman.hyperkitty.baseUrl`, or various things that affect
`mailman3/settings.py`
2020-03-02 02:25:20 +00:00
Martin Milata 097ab90850 nixos/sympa: init module 2020-02-07 22:54:27 +01:00
Alyssa Ross 0167eb303f nixos/mailman: make mailman package configurable
This will allow users to provide other archiver plugins than the
default mailman-hyperkitty.
2020-01-30 23:14:45 +00:00
Alyssa Ross 8f4fd4d9f5 nixos/mailman: restart services when config changed 2020-01-30 23:14:45 +00:00
Alyssa Ross 881dd9963f mailman-web: use upstream, improve NixOS module
Previously, some files were copied into the Nixpkgs tree, which meant
we wouldn't easily be able to update them, and was also just messy.

The reason it was done that way before was so that a few NixOS
options could be substituted in.  Some problems with doing it this way
were that the _package_ changed depending on the values of the
settings, which is pretty strange, and also that it only allowed those
few settings to be set.

In the new model, mailman-web is a usable package without needing to
override, and I've implemented the NixOS options in a much more
flexible way.  NixOS' mailman-web config file first reads the
mailman-web settings to use as defaults, but then it loads another
configuration file generated from the new services.mailman.webSettings
option, so _any_ mailman-web Django setting can be customised by the
user, rather than just the three that were supported before.  I've
kept the old options, but there might not really be any good reason to
keep them.
2020-01-30 23:14:45 +00:00
Alyssa Ross a8538a73a7 mailman: init package for Mailman CLI
We already had python3Packages.mailman, but that's only really usable
as a library.  The only other option was to create a whole Python
environment, which was undesirable to install as a system-wide
package.
2020-01-30 23:14:45 +00:00
Alyssa Ross 8d9636e092 nixos/mailman: don't set Postfix hashes
It's likely that a user might want to set multiple values for
relay_domains, transport_maps, and local_recipient_maps, and the order
is significant.  This means that there's no good way to set these
across multiple NixOS modules, and they should probably all be set
together in the user's Postfix configuration.

So, rather than setting these in the Mailman module, just make the
Mailman module check that the values it needs to occur somewhere, and
advise the user on what to set if not.
2020-01-30 23:14:45 +00:00
Alyssa Ross db0a3712bb nixos/mailman: support running through uwsgi 2020-01-30 23:14:45 +00:00
Alyssa Ross c397d1909f nixos/mailman: don't keep secrets in the Nix store
This replaces all Mailman secrets with ones that are generated the
first time the service is run.  This replaces the hyperkittyApiKey
option, which would lead to a secret in the world-readable store.
Even worse were the secrets hard-coded into mailman-web, which are not
just world-readable, but identical for all users!

services.mailman.hyperkittyApiKey has been removed, and so can no
longer be used to determine whether to enable Hyperkitty.  In its
place, there is a new option, services.mailman.hyperkitty.enable.  For
consistency, services.mailman.hyperkittyBaseUrl has been renamed to
services.mailman.hyperkitty.baseUrl.
2020-01-30 23:14:45 +00:00
Alyssa Ross 112fa077b1 nixos/mailman: siteOwner default -> example
A default of example.com is useful to nobody.  The correct value of
this depends on the system.
2020-01-30 23:14:45 +00:00
Alyssa Ross 547b91b971 nixos/mailman: add webUser option
Not everybody is using Apache.
2020-01-30 23:14:45 +00:00
Alyssa Ross 85a9743f13 spamassassin: use /etc/mail/spamassassin for config
Using a custom path in the Nix store meant that users of the module
couldn't add their own config files, which is a desirable feature.  I
don't think avoiding /etc buys us anything.
2020-01-30 00:47:10 +00:00
Symphorien Gibol 28321223d8 dovecot: add missing descriptions 2020-01-28 12:00:00 +00:00
Symphorien Gibol 7a40ced06b nixos/modules/services/mail/dovecot.nix: nixpkgs-fmt 2020-01-28 12:00:00 +00:00
symphorien 56f9c51b05 Update nixos/modules/services/mail/dovecot.nix
Co-Authored-By: Léo Gaspard <github@leo.gaspard.ninja>
2020-01-28 20:30:25 +01:00
Symphorien Gibol 0da7a14f16 nixos/dovecot: add an option to enable mail_plugins
Motivation:
if enableQuota is true, mail plugins cannot be enabled in extraConfig
because of the problem described here:

https://doc.dovecot.org/configuration_manual/config_file/config_file_syntax/#variable-expansion

doveconf: Warning: /etc/dovecot/dovecot.conf line 8: Global setting
mail_plugins won't change the setting inside an earlier filter at
/etc/dovecot/dovecot.conf line 5 (if this is intentional, avoid this
warning by moving the global setting before /etc/dovecot/dovecot.conf
line 5)
2020-01-28 20:30:25 +01:00
Maximilian Bosch 2d9e51adc3
Merge pull request #77532 from symphorien/roundcube
nixos/roundcube: security improvements
2020-01-22 21:58:25 +01:00
Symphorien Gibol b5d692e123 nixos/roundcube: provide path to mime.types file
fixes this warning:
WARNING: Mimetype to file extension mapping doesn't work properly!
2020-01-18 16:12:50 +01:00
Symphorien Gibol b6e6bec57c nixos/roundcube: don't use the default and insecure des_key
The php installer creates a random one, but we bypass it, so we have
to create one ourselves.

This should be backward compatible as encryption is used for session
cookies only: users at the time of the upgrade will be logged out but
nothing more.

259b7fa065/config/config.inc.php.sample (L73)
2020-01-18 16:12:50 +01:00
Symphorien Gibol 52cf727a53 nixos/roundcube: do not write passwords to the store nor run php as root
If the database is local, use postgres peer authentication.
Otherwise, use a password file.

Leave database initialisation to postgresql.ensure*.
Leave /var/lib/roundcube creation to systemd.
Run php upgrade script as unpriviledged user.
2020-01-18 15:27:45 +01:00
Jan Tojnar e85b34c484
tree-wide: fix more warning related to loaOf deprecation 2020-01-11 08:09:56 +01:00
Alyssa Ross 59c4035e58 nixos/spamassassin: allow initPreConf to be a path
Supporting a path here is important because it allows e.g. fetching a
configuration from a URL.  To do this and provide the configuration as
a string, IFD would be necessary.  It's just written into a path
anyway.
2020-01-10 21:49:06 +00:00
Milan Pässler 2a31a6a412 tree-wide: fix errors and warning related to loaOf deprecation 2020-01-07 06:23:28 +01:00
rnhmjoj 1d61efb7f1 treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
Silvan Mosberger 4ee3e8b21d
nixos/treewide: Move rename.nix imports to their respective modules
A centralized list for these renames is not good because:
- It breaks disabledModules for modules that have a rename defined
- Adding/removing renames for a module means having to find them in the
central file
- Merge conflicts due to multiple people editing the central file
2019-12-10 02:51:19 +01:00
Robin Gloster 5f7bcffe21
Merge pull request #71407 from f--t/fix/roundcube
roundcube: fix -- quoting string env variable
2019-11-20 09:25:10 +01:00
Aaron Andersen 07bba3fcd3
Merge pull request #73295 from aanderse/mailcatcher
nixos/mailcatcher: add http.path option
2019-11-19 17:15:52 -05:00
f--t 4c18309ca6
Merge branch 'master' into fix/roundcube 2019-11-19 13:16:16 -08:00
Victor Nawothnig f42b402706 Specify correct type for fuzzy worker 2019-11-18 13:56:56 +01:00
Alyssa Ross 7813c249ef
nixos/postfix: add missing setgid wrapper
This is basically an alias for a special case of postqueue, which
already has a setgid wrapper.  Would be silly to allow postqueue -p
but not mailq.
2019-11-13 15:31:32 +00:00
Aaron Andersen 1759424fc6 nixos/mailcatcher: add http.path option 2019-11-12 10:11:24 -05:00
Florian Klink e349b6e0fe nixos/opensmtpd: refactor to use tmpfiles to set up spool directories 2019-11-08 15:05:18 +01:00
ft 6a600b1c22 roundcube: fix -- quoting string env variable 2019-10-19 16:08:54 -07:00
Janne Heß d6c08776ba treewide: Switch to system users 2019-10-12 22:25:28 +02:00
Victor Nawothnig 187c0b3aef Specify correct option type 2019-10-04 09:57:06 +02:00
Jörg Thalheim bfed455de3
Merge pull request #68946 from volth/escape
treewide: fix string escapes
2019-09-24 04:19:12 +01:00
volth 6c038cd409
nixos/mailcatcher: add bind capabilities 2019-09-22 19:49:26 +00:00
volth 602a39c318
nixos/rspamd: fix fancy unicode quote 2019-09-16 23:40:32 +00:00
Alyssa Ross 27b459ce1e
nixos/mailman: types.string -> types.str 2019-09-11 14:14:09 +00:00
Peter Simons d0dba96e1d nixos/mailman: properly wrap the mailman-web script 2019-09-11 15:22:37 +02:00
Peter Simons a7941fe210 nixos/mailman: create "mailman" executable as a proper wrapper script 2019-09-11 15:11:34 +02:00