Commit Graph

176 Commits

Author SHA1 Message Date
Felix Buehler
0a78cd4f73 nixos/services.pantalaimon-headless: remove with lib; 2024-08-30 23:00:12 +02:00
Felix Buehler
ec70164f24 nixos/services.mx-puppet-discord: remove with lib; 2024-08-30 23:00:12 +02:00
Felix Buehler
0f517df99c nixos/services.mjolnir: remove with lib; 2024-08-30 23:00:11 +02:00
Felix Buehler
167cad7457 nixos/services.mautrix-telegram: remove with lib; 2024-08-30 23:00:11 +02:00
Felix Buehler
3bc24ab5d9 nixos/services.mautrix-facebook: remove with lib; 2024-08-30 23:00:11 +02:00
Felix Buehler
24edb42066 nixos/services.matrix-conduit: remove with lib; 2024-08-30 23:00:11 +02:00
Felix Buehler
ca941e19f3 nixos/services.matrix-appservice-irc: remove with lib; 2024-08-30 23:00:11 +02:00
Felix Buehler
0db184a132 nixos/services.matrix-appservice-discord: remove with lib; 2024-08-30 22:59:29 +02:00
Alexander Linder
06855f1cd8
nixos/mautrix-whatsapp: automatic appservice registration option, pull login_shared_secret_map setting from env file (#311681)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2024-08-22 14:14:51 +02:00
Sandro
33f83c6252
Merge pull request #316977 from eclairevoyant/fix-mkEnableOption
treewide: fix mkEnableOption usage
2024-06-25 22:42:16 +02:00
Guanran928
ba7e7693dc
nixos/matrix-synapse: fix typo 2024-06-20 13:53:38 +08:00
éclairevoyant
7d8742da87
treewide: fix mkEnableOption usage 2024-06-14 02:41:42 -04:00
Niklas Korz
346d23fdf2 nixos/mautrix-signal: add module 2024-05-05 13:57:50 +02:00
piegames
3813ff1a48 conduit: Drop piegames from maintainers 2024-05-03 13:38:00 +02:00
Patrick Steinhardt
ff3358b3f5 nixos/matrix-appservice-irc: fix chown of registration.yml in pre-script
Before the startup, the matrix-appservice-irc service sets up the
registration file such that it can be used by matrix-synapse. Part of
that setup requires us to change the group of said file so that the home
server can read it. Consequently, we need CAP_CHOWN and require that the
@chown system calls are allowed.

While we supposedly set up both of these, the setup of system calls is
broken as we have both an allow and a deny list of syscalls. But while
the allow list contains "@chown", the deny list contains "@privileged"
which contains "@chown" itself. So ultimately, we end up denying
"@chown".

Fix this issue by specifying "@chown" after the deny list.
2024-04-27 19:04:08 +02:00
nat-418
d24376448b
docs(conduit): update link to config docs 2024-04-24 09:11:03 +02:00
Maximilian Bosch
52432f0a45
Merge pull request #302586 from Ma27/synapse-initialscript-docs
nixos/matrix-synapse: don't use `services.postgresql.initialScript` in setup example
2024-04-13 20:07:12 +00:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Maximilian Bosch
a3d3cdf5d9
nixos/matrix-synapse: don't use services.postgresql.initialScript in setup example
Closes #285688

This is misleading because `initialScript` will only be executed at the
*very first* run of postgresql. I.e. when deploying synapse to a server
with an existing postgresql, this won't work.

We don't have a good way of automatically provisioning databases
_declaratively_, so for now just explain what needs to be done here and
leave it to the user how to include this into their deployment.
2024-04-10 17:43:02 +02:00
Bjørn Forsman
a29010fe79 nixos: improve many 'enable' descriptions 2024-04-09 07:10:17 +02:00
Colin
5468e6802a nixos/mautrix-meta: fix lax enable check
enabledInstances is an attrset: the previous logic would always pass and
result in, for example, a `mautrix-meta` and a
`mautrix-meta-registration` group being shipped to every nixos machine
whether mautrix was enabled or not.
2024-04-05 20:05:41 +00:00
Kevin Cox
9c636e8416
Merge pull request #296718 from Rutherther/mautrix-meta-init
mautrix-meta: init at 0.2.0
2024-04-04 18:07:19 -04:00
Rutherther
5effc7956a mautrix-meta: init service
Acked-by: Rutherther <rutherther@proton.me>
2024-04-02 19:16:45 +02:00
Janne Heß
fcc95ff817 treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
2024-03-28 09:28:12 +01:00
Janne Heß
bc77c7a973 treewide: Mark Nix blocks in markdown as Nix
This should help us with highlighting and future formatting.
2024-03-28 09:28:12 +01:00
Maximilian Bosch
0d17fd9524
Merge pull request #292473 from networkException/fix-synapse-unix-socket-permissions
nixos/matrix-synapse: allow synapse to write to directories of unix socket paths
2024-03-15 18:53:04 +00:00
networkException
f0097cf1d9
nixos/matrix-sliding-sync: create runtime directory in /run/matrix-sliding-sync
this patch enables the creation of a runtime directory with the default
mode 0755 in /run/matrix-sliding-sync to offer a simple option for
SYNCV3_BINDADDR when using unix sockets.
2024-03-08 23:16:05 +01:00
networkException
10fc05bfc1
nixos/matrix-synapse: allow synapse to write to directories of unix socket paths
this patch takes the path of all unix socket listeners and appends their
respective parent directories to the ReadWritePaths allow list for the
matrix-synapse systemd service.

previously configuring a unix socket in a directory not writable by
synapse would fail.
2024-03-01 02:36:29 +01:00
networkException
644eac31e6
nixos/matrix-sliding-sync: document unix socket support in SYNCV3_BINDADDR 2024-02-29 11:03:01 +01:00
Martin Weinelt
91d9c159da
nixos/matrix-synapse: fix recursive filtering of null values
Using `filterAttrsRecursive` is not sufficient to account for a nested
attribute set with list values, like used for listeners.
2024-02-09 16:05:05 +01:00
Martin Weinelt
143d266f0d
nixos/matrix-synapse: add UNIX domain socket listener support
Exposes two options, `path` and `mode`, to configure the location and
permissions on the socket file.

The `mode` needs to be specified as string in octal and will be converted
into a decimal integer, so it correctly passes through the YAML parser
and arrives at the `os.chmod` call in the Twisted codebase. What a fun
detour.

Adds an assertion, that either `path` or `bind_addresses` and `port` are
configured on every listener.

Migrates the default replication listener of the main instance to a UNIX
domain socket, because it is more efficient.

Introduces the `enableRegistrationScript` option, to gracefully disable
the user registration script, when the client listener listens on a UNIX
domain socket, which is something the script does not support.
2024-02-09 16:05:05 +01:00
Raito Bezarius
78bc60b8a4 nixos/hebbot: init
This is a NixOS module to support TWIM-style Matrix bots.
2024-01-25 18:27:33 +01:00
Jade Lovelace
6c5ab28fce nixos: fix a bunch of services missing dep on network-online.target
This was done by generating a truly hilarious configuration:

rg 'services\.[^.]+\.enable\t' opts-tags | cut -f1 > allonconfig.nix

The following were not tested due to other evaluation errors. They
should probably be manually audited.
services.amule
services.castopod
services.ceph
services.chatgpt-retrieval-plugin
services.clamsmtp
services.clight
services.dante
services.dex
services.discourse
services.dwm-status
services.engelsystem
services.foundationdb
services.frigate
services.frp
services.grocy
services.guacamole-client
services.hedgedoc
services.home-assistant
services.honk
services.imaginary
services.jitsi-meet
services.kerberos_server
services.limesurvey
services.mastodon
services.mediawiki
services.mobilizon
services.moodle
services.mosquitto
services.nextcloud
services.nullmailer
services.patroni
services.pfix-srsd
services.pgpkeyserver-lite
services.postfixadmin
services.roundcube
services.schleuder
services.self-deploy
services.slskd
services.spacecookie
services.statsd
services.step-ca
services.sympa
services.tsmBackup
services.vdirsyncer
services.vikunja
services.yandex-disk
services.zabbixWeb
2024-01-19 00:11:34 -08:00
sinanmohd
e8e5c07ad0 nixos/matrix-sliding-sync: rename, init dendrite 2023-12-30 00:25:57 +05:30
Nick Cao
ee4176d325
nixos/matrix-synapse: update broken link to redis related docs 2023-12-13 18:02:47 -05:00
Nick Cao
3d7e5f4f26
nixos/matrix-synapse: replace references to matrix-org/synapse with element-hq/synapse 2023-12-13 17:50:37 -05:00
chayleaf
57e3ca7057
nixos/maubot: fix eval with default config 2023-12-08 17:35:11 +07:00
Benjamin Saunders
dffba14043 nixos/matrix-appservice-irc: fix syscall filter
The pre-start script requires @chown; the service fails without it.
2023-12-02 12:03:58 -08:00
h7x4
79d3d59f58
treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
Weijia Wang
feeae486de
Merge pull request #261702 from h7x4/replace-mkoption-with-mkpackageoption
treewide: use `mkPackageOption`
2023-11-30 02:49:30 +01:00
chayleaf
00070cf866
nixos/maubot: init 2023-11-28 20:35:55 +07:00
h7x4
0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Maximilian Bosch
48459567ae nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgresql15
Closes #216989

First of all, a bit of context: in PostgreSQL, newly created users don't
have the CREATE privilege on the public schema of a database even with
`ALL PRIVILEGES` granted via `ensurePermissions` which is how most of
the DB users are currently set up "declaratively"[1]. This means e.g. a
freshly deployed Nextcloud service will break early because Nextcloud
itself cannot CREATE any tables in the public schema anymore.

The other issue here is that `ensurePermissions` is a mere hack. It's
effectively a mixture of SQL code (e.g. `DATABASE foo` is relying on how
a value is substituted in a query. You'd have to parse a subset of SQL
to actually know which object are permissions granted to for a user).

After analyzing the existing modules I realized that in every case with
a single exception[2] the UNIX system user is equal to the db user is
equal to the db name and I don't see a compelling reason why people
would change that in 99% of the cases. In fact, some modules would even
break if you'd change that because the declarations of the system user &
the db user are mixed up[3].

So I decided to go with something new which restricts the ways to use
`ensure*` options rather than expanding those[4]. Effectively this means
that

* The DB user _must_ be equal to the DB name.
* Permissions are granted via `ensureDBOwnerhip` for an attribute-set in
  `ensureUsers`. That way, the user is actually the owner and can
  perform `CREATE`.
* For such a postgres user, a database must be declared in
  `ensureDatabases`.

For anything else, a custom state management should be implemented. This
can either be `initialScript`, doing it manual, outside of the module or
by implementing proper state management for postgresql[5], but the
current state of `ensure*` isn't even declarative, but a convergent tool
which is what Nix actually claims to _not_ do.

Regarding existing setups: there are effectively two options:

* Leave everything as-is (assuming that system user == db user == db
  name): then the DB user will automatically become the DB owner and
  everything else stays the same.

* Drop the `createDatabase = true;` declarations: nothing will change
  because a removal of `ensure*` statements is ignored, so it doesn't
  matter at all whether this option is kept after the first deploy (and
  later on you'd usually restore from backups anyways).

  The DB user isn't the owner of the DB then, but for an existing setup
  this is irrelevant because CREATE on the public schema isn't revoked
  from existing users (only not granted for new users).

[1] not really declarative though because removals of these statements
    are simply ignored for instance: https://github.com/NixOS/nixpkgs/issues/206467
[2] `services.invidious`: I removed the `ensure*` part temporarily
    because it IMHO falls into the category "manage the state on your
    own" (see the commit message). See also
    https://github.com/NixOS/nixpkgs/pull/265857
[3] e.g. roundcube had `"DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";`
[4] As opposed to other changes that are considered a potential fix, but
    also add more things like collation for DBs or passwords that are
    _never_ touched again when changing those.
[5] As suggested in e.g. https://github.com/NixOS/nixpkgs/issues/206467
2023-11-13 17:16:25 +01:00
Sophie Tauchert
8627e0ef58
nixos/matrix/*: change dependencies on matrix-synapse.service to serviceUnit 2023-11-05 21:43:08 +01:00
Sophie Tauchert
70dc536ae0
nixos/matrix-synapse: add readOnly serviceUnit option
This is useful to configure services dependent on matrix-synapse regardless
of whether workers are enabled or not.
2023-11-05 21:38:39 +01:00
Sophie Tauchert
c8b5539626
nixos/matrix-sliding-sync: add dependency on matrix-synapse if running locally and restart 2023-11-05 21:31:20 +01:00
Yureka
0288685a4d nixos/matrix-synapse: remove opentracing options 2023-10-22 14:15:39 +02:00
Bjørn Forsman
142074c2a8 nixos: fix bad mkEnableOption descriptions
Fix descriptions that don't account for (1) the "Whether to enable"
prefix or (2) the automatically added trailing dot.
2023-10-20 16:22:40 +01:00
Maximilian Bosch
3357e6df46
Merge pull request #260008 from Ma27/synapse-log-config
nixos/matrix-synapse: mergeable log configuration
2023-10-16 18:01:44 +00:00
Maximilian Bosch
e5928d9a73
nixos/synapse: mkDefault each value of the log config
That way it's not even needed to specify an `mkForce` when changing
existing attributes, e.g. root's log level.
2023-10-15 16:16:28 +02:00