Commit Graph

564 Commits

Author SHA1 Message Date
Sandro Jäckel
b2c1b176d9
nixos/nullmailer: allow users in the nullmailer group to send mails
In combination with https://github.com/NixOS/nixpkgs/pull/231673 this
allows hardened services to use nullmailer's sendmail.
2023-07-13 17:02:19 +02:00
Luke Granger-Brown
cba7cd9b6d
Merge pull request #233282 from pkern/spamassassin
spamassassin: 3.4.6 → 4.0.0
2023-06-25 23:55:34 +01:00
Luke Granger-Brown
58b48cd720 nixos/spamassassin: add DMARC module to default config 2023-06-25 17:35:16 +00:00
pennae
32deda9ec0
Merge pull request #238222 from mads256h/harden-davmail
davmail: enable sandboxing options
2023-06-25 14:57:19 +02:00
Philipp Kern
0ce6a09235 spamassassin: 3.4.6 → 4.0.0
The HashCash module has been removed, so this change also drops it from
the default config for spamassassin.
2023-06-25 09:38:10 +00:00
Alyssa Ross
eafa1fd10d nixos/public-inbox: set ProtectHome=tmpfs
This fixes using coderepos in /home, by allowing the coderepo paths to
be bind mounted into an otherwise empty /home tmpfs.  Since this was
the usecase for making ProtectHome= overrideable, we don't need the
mkDefault any more.
2023-06-20 17:19:09 +00:00
Alyssa Ross
03216e705c nixos/public-inbox: make coderepo paths accessible 2023-06-20 17:19:09 +00:00
Alyssa Ross
68c68f39db nixos/public-inbox: remove unused indexing code
This was never run, because public-inbox-init now always initializes
Xapian.
2023-06-20 17:11:23 +00:00
Mads Mogensen
40c923aa13
davmail: enable sandboxing options
The output from `systemd-analyze security davmail`:
Before: `Overall exposure level for davmail.service: 8.2 EXPOSED 🙁`
After: `Overall exposure level for davmail.service: 1.3 OK 🙂`
2023-06-17 11:32:42 +02:00
Alyssa Ross
18f2be2e56 nixos/public-inbox: require that URL be non-empty
public-inbox-init doesn't work if passed an empty URL.
2023-06-17 07:57:27 +00:00
Pol Dellaiera
7907dd9d6b
Merge pull request #235924 from Stunkymonkey/remove-then-{}
treewide: use lib.optionalAttrs instead of 'then {}'
2023-06-13 20:14:58 +02:00
Felix Buehler
ed3b102d1e treewide: use use lib.optionalAttrs instead of 'then {}' 2023-06-06 22:54:31 +02:00
pacien
54be076ae7 nixos/exim: apply privilege restrictions
Since 816614bd62, the service is set to use the exim user so that
systemd takes care of the credentials ownership. The executable is
still required to run as root, to then drop privileges. The prefix '+'
that was used however interfers with the use of privilege restrictions
and other sandboxing options. Since we only want to escape the "User"
setting, we can use the '!' prefix instead.
2023-06-05 20:04:48 +02:00
Julien Moutinho
b6ed3b8f40 nixos/public-inbox: explicit a few more freeform settings 2023-06-04 13:09:28 +00:00
Jonas Heinrich
63f73b3295
nixos/maddy: change secrets option to accept a list of paths 2023-05-30 12:41:07 +08:00
figsoda
701bcdbead nixos: fix typos 2023-05-19 22:31:04 -04:00
Alyssa Ross
7ddca49451 nixos/mailman: set RemainAfterExit for settings
This seems to be required to have the unit re-run if
services.mailman.restApiPassFile gets set.
2023-05-19 12:03:41 +02:00
Alyssa Ross
43465c94d4 nixos/mailman: randomly generate REST API token 2023-05-19 12:03:41 +02:00
Jonas Heinrich
8a4f016281 nixos/maddy: tls.loader add acme support, add secrets option 2023-05-15 15:00:16 -04:00
Jonas Heinrich
d932d6929b
Merge pull request #227401 from onny/maddytls2
nixos/maddy: Add tls option
2023-05-02 07:32:56 +02:00
Jonas Heinrich
616ba4ae5c nixos/maddy: Add tls option 2023-05-01 19:12:26 +02:00
Andreas Brinner
9d5dba7170 nixos/roundcube: read only first line of password file
Only read the first line of the password file, if has multiple lines.
Mention that behaviour in options documentation.
2023-04-23 21:05:48 +02:00
Andreas Brinner
78fb35ce39 nixos/roundcube: extend documentation for passwordFile
The passwordFile must be formatted correctly. Added some information
about how the file content should look like.
2023-04-23 14:05:40 +02:00
Andreas Brinner
279eeae178 nixos/roundcube: fix roundcube-setup start
When using Roundcube with a non local PostgreSQL database wait for
network start before running roundcube-setup.service
Otherwise the database is not reachable and the service fails.
2023-04-23 13:11:28 +02:00
Andreas Brinner
2af4a9bc09 nixos/roundcube: fix PostgreSQL password
Extract PostgreSQL database password for Roundcube from .pgpass file.
The password file is used in two locations:

  1. in the Roundcube config.php
  2. in the systemd setup service that initializes the roundcube
     database

These two services need the password in different formats.

Keep the password file in PostgreSQL standard format and extract the
password for the Roundcube config (see #215986).
2023-04-23 13:11:28 +02:00
Artturi
b83db86a9e
Merge pull request #222080 from Stunkymonkey/nixos-optionalString 2023-04-20 16:07:30 +03:00
Ryan Lahfa
b914dffe7e
Merge pull request #224494 from LeSuisse/roundcube-php81
nixos/roundcube: use PHP 8.1
2023-04-15 22:12:31 +02:00
Jonas Heinrich
86a685ceb1 nixos/maddy: Add option ensureCredentials 2023-04-13 09:36:54 -04:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Thomas Gerbet
188573bf93 nixos/roundcube: use PHP 8.1
Roundcube has announced support of PHP 8.1 in the 1.6.0

https://github.com/roundcube/roundcubemail/releases/tag/1.6.0
2023-04-03 18:21:35 +02:00
ettom
a375b000a6 nixos/zeyple: init 2023-03-21 00:14:03 +02:00
Izorkin
6263c45580
nixos/roundcube: add tmp directory 2023-03-17 19:40:23 +03:00
Luke Granger-Brown
f43347d8a3
Merge pull request #214346 from SFrijters/postfix-ipv4
nixos/postfix: restrict inet_protocols to ipv4 when ipv6 is disabled
2023-02-27 18:24:53 +00:00
Jonas Heinrich
13ff144c70 nixos/maddy: Add option ensureAccounts 2023-02-17 17:42:27 -05:00
pennae
bf4c0c1900 nixos/*: remove trailing period in mkEnableOptions
those are added by mkEnableOption, and .. is replaced to … by markdown
processing.
2023-02-08 15:23:34 +01:00
paumr
9d4fdb9685 nixos/roundcube: fixed nginx configuration
the changes are required for oauth setups,
and are based on:
https://github.com/roundcube/roundcubemail/issues/8191#issuecomment-919850328
2023-02-06 18:11:42 +01:00
Stefan Frijters
11fa179533
nixos/postfix: restrict inet_protocols to ipv4 when ipv6 is disabled
In the previous state, postfix would still try to use IPv6 addresses,
even when it is disabled in the global networking config.

Cf. https://www.postfix.org/postconf.5.html:

  With Postfix 2.8 and earlier the default is "ipv4". For backwards compatibility with these releases,
  the Postfix 2.9 and later upgrade procedure appends an explicit "inet_protocols = ipv4" setting to
  main.cf when no explicit setting is present.
  This compatibility workaround will be phased out as IPv6 deployment becomes more common.

  inet_protocols = ipv4
  inet_protocols = all (DEFAULT)
  inet_protocols = ipv6
  inet_protocols = ipv4, ipv6

So setting it to 'all' conditionally does not help, as we are now on version 3.x.
2023-02-03 11:29:24 +01:00
pennae
0a6e6cf7e6 nixos/manual: render module chapters with nixos-render-docs
this converts meta.doc into an md pointer, not an xml pointer. since we
no longer need xml for manual chapters we can also remove support for
manual chapters from md-to-db.sh

since pandoc converts smart quotes to docbook quote elements and our
nixos-render-docs does not we lose this distinction in the rendered
output. that's probably not that bad, our stylesheet didn't make use of
this anyway (and pre-23.05 versions of the chapters didn't use quote
elements either).

also updates the nixpkgs manual to clarify that option docs support all
extensions (although it doesn't support headings at all, so heading
anchors don't work by extension).
2023-01-27 20:07:34 +01:00
Bruno Inec
dbbb062d47
Apply suggestion
Co-authored-by: Aaron Andersen <aaron@fosslib.net>
2023-01-20 14:39:35 +01:00
Bruno Inec
edb6b10966
add warning if not using password_file 2023-01-20 00:39:34 +01:00
Bruno Inec
5edf9bd76f
Apply suggestion
Co-authored-by: Aaron Andersen <aaron@fosslib.net>
2023-01-20 00:39:34 +01:00
Bruno Inec
15414ff8e1
databaseDirectory -> StateDir and changed description 2023-01-20 00:39:33 +01:00
Bruno Inec
8f10857af4
let systemd handle /var/lib/goeland creation 2023-01-20 00:39:32 +01:00
Bruno Inec
988feead01
nixos/goeland: init 2023-01-20 00:39:31 +01:00
pennae
53fc887582 nixos/manual: move "edit the MD file" comments to generated XML 2023-01-10 12:34:37 +01:00
pennae
bf92eaebe4 nixos/manual: generate module chapters with md-to-db.sh 2023-01-10 10:32:00 +01:00
pennae
23ea73b416 nixos/manual: enable smart quotes for all MD chapters 2023-01-10 10:31:59 +01:00
pennae
5320b4cff8 nixos/mailman: convert manual chapter to MD 2023-01-10 10:31:56 +01:00
pennae
0715ecf936 nixos/manual: normalize <programlisting>
makes sure that program listing tags are separated from their contents
by exactly a newline character. this makes the markdown translation
easier to verify (since no new newlines need to be inserted), and
there's no rendering difference anyway.
2023-01-10 10:31:52 +01:00
pennae
80a78f2e1e nixos/manual: remove links from program listings
markdown cannot represent those links. remove them all now instead of in
each chapter conversion to keep the diff for each chapter small and more
understandable.
2023-01-10 10:31:52 +01:00
Robin Gloster
271c20dd40
Merge pull request #209022 from mayflower/fix-mailman-hyperkitty-css
nixos/mailman: fix hyperkitty css/js when virtualRoot is `/`
2023-01-05 17:29:08 +01:00
pennae
9da5f12ecf modules: add mkPackageOptionMD
another transitional option factory, like mkAliasOptionModuleMD.
2023-01-05 02:33:13 +01:00
Maximilian Bosch
05f6dd4dc6
nixos/mailman: fix hyperkitty css/js when virtualRoot is /
The `manage-script-name` / `mount` approach doesn't work if you don't
serve your instance behind e.g. `/lists`.
2023-01-04 11:59:27 +01:00
Sandro
1fc59dfbc7
Merge pull request #206102 from 4z3/exim-can-credentials 2022-12-28 20:53:22 +01:00
Vincent Ambo
aea521150d nixos/public-inbox: fix incorrectly restrictive option type
The `freeformType` of `settings.publicinbox` in this module prevented
users from setting settings on the `publicinbox` section itself (which
is necessary for making e.g. IMAP work correctly), and only allowed
configuration of nested per-inbox sections.

In general I believe that these overly specific types which are
traditional in NixOS, and this kind of config generation, are a huge
footgun. This commit is the least invasive change that makes the
module work correctly.
2022-12-25 16:45:58 +03:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Artturin
05a2dfd674 lib.replaceChars: warn about being a deprecated alias
replaceStrings has been in nix since 2015(nix 1.10)

so it is safe to remove the fallback

d6d5885c15
2022-12-15 22:25:51 +02:00
tv
816614bd62 nixos/exim: allow using service credentials
By settings User= to the actual Exim user, systemd will ensure that the
credentials directory will have the correct ownership, allowing users to
utilize LoadCredential=.  Exim still gets started as root (and drops
privileges) to preserve the previous behavior.
2022-12-14 16:43:46 +01:00
Maximilian Bosch
367897a68b
nixos/mailman: remove trailing slash from /static location
Otherwise HTTP routes such as `/static/django-mailman3/css/main.css`
will cause a 404.
2022-12-03 13:03:26 +01:00
amesgen
733ea72e16
nixos/rss2email: remove unnecessary cfg file indirection to fix test (#200108)
Previously, the NixOS test often failed as the copied config file is not
overwriteable. In actual setups, the restart interval is much bigger, such that
systemd-tmpfiles will correct the permissions inbetween.
2022-11-10 20:06:32 +01:00
Maximilian Bosch
91d7b27cfb
Merge pull request #189756 from alyssais/mailman-virtualRoot
nixos/mailman: add serve.virtualRoot option
2022-11-06 12:42:48 +01:00
MidAutumnMoon
d3a95ce32c
nixos/listmonk: set proper SystemCallFilter 2022-10-25 11:55:18 +08:00
Christian Kögler
1c23b486f2
Merge pull request #189275 from wentasah/nullmailer-ownership
nixos/nullmailer: Always adjust ownership of spool directories
2022-10-01 12:51:57 +02:00
Sandro
fad61ad09c
Merge pull request #188949 from RaitoBezarius/listmonk-module 2022-09-21 23:42:03 +02:00
Raito Bezarius
6b891f4788 nixos/listmonk: init module 2022-09-21 19:55:20 +02:00
Alyssa Ross
1cdd9a3fe6
nixos/mailman: add serve.virtualRoot option
On spectrum-os.org, mailman-web is run at /lists.  With this change,
it's possible for us to switch from a custom uWSGI configuration to
the one now built in to the Mailman module.
2022-09-07 07:10:27 +00:00
Michal Sojka
7e626703b0 nixos/nullmailer: Always adjust ownership of spool directories
When switching between different NixOS configurations (with and
without nullmailer and other services), it can happen that the UID of
the nullmailer user changes. When it happens, the nullmailer service
happily starts, but the user cannot send any email, because the
sendmail wrapper doesn't have permission to write them to the queue.

This commit prevents that. Instead of creating the directories by the
nullmailer user, which doesn't have permissions to change ownership,
we now create them by the systemd-tmpfiles, which has sufficient
permissions to adjust ownership.
2022-09-01 15:40:27 +02:00
pennae
1d41cff3dc nixos/*: convert straggler options to MD 2022-08-31 17:27:38 +02:00
pennae
722b99bc0e nixos/*: convert options with admonitions to MD
rendering changes only slightly, most changes are in spacing.
2022-08-31 16:36:16 +02:00
pennae
bd56368848 nixos/*: md-convert hidden plaintext options
most of these are hidden because they're either part of a submodule that
doesn't have its type rendered (eg because the submodule type is used in
an either type) or because they are explicitly hidden. some of them are
merely hidden from nix-doc-munge by how their option is put together.
2022-08-31 16:32:54 +02:00
pennae
515c4727fa nixos/*: md-"convert" empty descriptions
for some reason these are not picked up properly by nix-doc-munge, so
we'll do this instead.
2022-08-31 16:32:54 +02:00
pennae
9547123258 nixos/*: convert internal option descriptions to MD
we'll have to do it eventually, may as well be now.
2022-08-31 16:32:54 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
1013069f52 nixos/*: convert more partially-md option descriptions
this mostly means marking options that use markdown already
appropriately and making a few adjustments so they still render
correctly. notable for nftables we have to transform the md links
because the manpage would not render them correctly otherwise.
2022-08-31 16:32:14 +02:00
pennae
0046b457d5 nixos/public-inbox: convert option descriptions to MD
no change to manpage or html.
2022-08-27 19:18:29 +02:00
pennae
6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
pennae
b51f8036c2 nixos/*: use properly indented strings for option docs
using regular strings works well for docbook because docbook is not as
whitespace-sensitive as markdown. markdown would render all of these as
code blocks when given the chance.
2022-08-19 22:40:58 +02:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
pennae
423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae
61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +02:00
pennae
3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +02:00
pennae
9c8531c8a5 nixos/*: replace <replaceable>s with «thing»
we can't embed syntactic annotations of this kind in markdown code
blocks without yet another extension. replaceable is rare enough to make
this not much worth it, so we'll go with «thing» instead. the module
system already uses this format for its placeholder names in attrsOf
paths.
2022-08-03 21:08:58 +02:00
pennae
16102dce2f nixos/*: replace <code> in option docs with <literal>
markdown can't represent the difference without another extension and
both the html manual and the manpage render them the same, so keeping the
distinction is not very useful on its own. with the distinction removed
we can automatically convert many options that use <code> tags to markdown.

the manpage remains unchanged, html manual does not render
differently (but class names on code tags do change from "code" to "literal").
2022-08-03 21:03:23 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Maximilian Bosch
db9937b578
nixos/mailman: don't leak MAILMAN_REST_API_PASS into the store 2022-07-20 22:23:54 +02:00
Maximilian Bosch
6a5b1bc0a3
nixos/mailman: strip trailing \n when reading the secret 2022-07-04 21:15:56 +02:00
Maximilian Bosch
dd4b6b81fa
nixos/mailman: implement LDAP support for postorius 2022-07-04 21:15:53 +02:00
Linus Heckemann
1dabedae3e nixos/schleuder: init module and accompanying test
Co-Authored-By: Martin Weinelt <hexa@darmstadt.ccc.de>
Co-Authored-By: Cole Helbling <cole.helbling@determinate.systems>
2022-06-24 15:30:16 -04:00
Elis Hirwing
c53c34ee72
nixos/postfixadmin: Upgrade to PHP 8.1 2022-06-08 18:08:56 +02:00
Jörg Thalheim
e2e77bfb9a
Merge pull request #173978 from alyssais/postfix-RemainAfterExit
nixos/postfix: make postfix-setup RemainAfterExit
2022-05-22 12:04:04 +01:00
Alyssa Ross
27530ba856
nixos/postfix: make postfix-setup RemainAfterExit
Otherwise, it wouldn't get restarted when a new system configuration
was activatad, so the Postfix configuration wouldn't be updated.

Fixes: fb2fa1b50f ("nixos/postfix: pull setup into its own unit")
2022-05-22 10:33:22 +00:00
Maximilian Bosch
aea3ec632d
mailman: split python env for web and mailman 2022-05-20 01:36:48 +02:00
Maximilian Bosch
72a14ea563
mailman: refactor package structure
* Removed unused `.package`-option.
* Added explicit postgresql support.
* Create a new meta-package for mailman to make sure each component has
  the **same** python and packages can be downgraded if needed (e.g.
  psycopg2 or sqlalchemy) without interfering with `pythonPackages` in any way.
* Document why certain python overrides are needed.

Closes #170035
Closes #158424
2022-05-20 01:21:20 +02:00
Silvan Mosberger
fd50826952
Merge pull request #104457 from ju1m/public-inbox
Update public-inbox to 1.8.0 and add systemd services
2022-05-12 20:46:39 +02:00
Julien Moutinho
c646d375d3 nixos/public-inbox: support enabling confinement
Add support for enabling confinement
but does not enable it by default yet
because so far no module within NixOS uses confinement
hence that would set a precedent.
2022-05-12 01:56:46 +02:00
Julien Moutinho
0e290442ba nixos/public-inbox: add tests 2022-05-12 01:56:16 +02:00
Julien Moutinho
8514800c42 nixos/public-inbox: init 2022-05-12 01:56:15 +02:00
Janne Heß
57cd07f3a9
treewide: pkgs.systemd -> config.systemd.package
This ensures there is only one systemd package when e.g. testing the
next systemd version.
2022-05-05 20:00:31 +02:00
Linus Heckemann
5e513b4b24
Merge pull request #167324 from alyssais/mailman-postfix
nixos/{postfix,mailman}: fix ordering between services
2022-04-20 16:34:43 +02:00
Alyssa Ross
572131c6a9
nixos/mailman: ensure Postfix is started after Mailman
On first run, Postfix will refuse to start if it's started before
Mailman is up, because it'll try to read the map files generated
Mailman the first time it's started, and they won't exist yet.  To fix
this, make sure Postfix isn't started until after Mailman is up if
they're both activated at the same time.
2022-04-20 13:17:28 +00:00