···2223- [Broadcast Box](https://github.com/Glimesh/broadcast-box), a WebRTC broadcast server. Available as [services.broadcast-box](options.html#opt-services.broadcast-box.enable).
240025- [SuiteNumérique Docs](https://github.com/suitenumerique/docs), a collaborative note taking, wiki and documentation web platform and alternative to Notion or Outline. Available as [services.lasuite-docs](#opt-services.lasuite-docs.enable).
2627[dwl](https://codeberg.org/dwl/dwl), a compact, hackable compositor for Wayland based on wlroots. Available as [programs.dwl](#opt-programs.dwl.enable).
···2223- [Broadcast Box](https://github.com/Glimesh/broadcast-box), a WebRTC broadcast server. Available as [services.broadcast-box](options.html#opt-services.broadcast-box.enable).
2425+- [Draupnir](https://github.com/the-draupnir-project/draupnir), a Matrix moderation bot. Available as [services.draupnir](#opt-services.draupnir.enable).
26+27- [SuiteNumérique Docs](https://github.com/suitenumerique/docs), a collaborative note taking, wiki and documentation web platform and alternative to Notion or Outline. Available as [services.lasuite-docs](#opt-services.lasuite-docs.enable).
2829[dwl](https://codeberg.org/dwl/dwl), a compact, hackable compositor for Wayland based on wlroots. Available as [programs.dwl](#opt-programs.dwl.enable).
···1+# Draupnir (Matrix Moderation Bot) {#module-services-draupnir}
2+3+This chapter will show you how to set up your own, self-hosted
4+[Draupnir](https://github.com/the-draupnir-project/Draupnir) instance.
5+6+As an all-in-one moderation tool, it can protect your server from
7+malicious invites, spam messages, and whatever else you don't want.
8+In addition to server-level protection, Draupnir is great for communities
9+wanting to protect their rooms without having to use their personal
10+accounts for moderation.
11+12+The bot by default includes support for bans, redactions, anti-spam,
13+server ACLs, room directory changes, room alias transfers, account
14+deactivation, room shutdown, and more. (This depends on homeserver configuration and implementation.)
15+16+See the [README](https://github.com/the-draupnir-project/draupnir#readme)
17+page and the [Moderator's guide](https://the-draupnir-project.github.io/draupnir-documentation/moderator/setting-up-and-configuring)
18+for additional instructions on how to setup and use Draupnir.
19+20+For [additional settings](#opt-services.draupnir.settings)
21+see [the default configuration](https://github.com/the-draupnir-project/Draupnir/blob/main/config/default.yaml).
22+23+## Draupnir Setup {#module-services-draupnir-setup}
24+25+First create a new unencrypted, private room which will be used as the management room for Draupnir.
26+This is the room in which moderators will interact with Draupnir and where it will log possible errors and debugging information.
27+You'll need to set this room ID or alias in [services.draupnir.settings.managementRoom](#opt-services.draupnir.settings.managementRoom).
28+29+Next, create a new user for Draupnir on your homeserver, if one does not already exist.
30+31+The Draupnir Matrix user expects to be free of any rate limiting.
32+See [Synapse #6286](https://github.com/matrix-org/synapse/issues/6286)
33+for an example on how to achieve this.
34+35+If you want Draupnir to be able to deactivate users, move room aliases, shut down rooms, etc.
36+you'll need to make the Draupnir user a Matrix server admin.
37+38+Now invite the Draupnir user to the management room.
39+Draupnir will automatically try to join this room on startup.
40+41+```nix
42+{
43+ services.draupnir = {
44+ enable = true;
45+46+ settings = {
47+ homeserverUrl = "https://matrix.org";
48+ managementRoom = "!yyy:example.org";
49+ };
50+51+ secrets = {
52+ accessToken = "/path/to/secret/containing/access-token";
53+ };
54+ };
55+}
56+```
57+58+### Element Matrix Services (EMS) {#module-services-draupnir-setup-ems}
59+60+If you are using a managed ["Element Matrix Services (EMS)"](https://ems.element.io/)
61+server, you will need to consent to the terms and conditions. Upon startup, an error
62+log entry with a URL to the consent page will be generated.
···294 ++
295 lib.optional (lib.versionAtLeast release_version "15")
296 # Just like the `llvm-lit-cfg` patch, but for `polly`.
297- (getVersionFile "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch");
0000000000298299 nativeBuildInputs =
300 [
···294 ++
295 lib.optional (lib.versionAtLeast release_version "15")
296 # Just like the `llvm-lit-cfg` patch, but for `polly`.
297+ (getVersionFile "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch")
298+ ++
299+ lib.optional (lib.versions.major release_version == "20")
300+ # https://github.com/llvm/llvm-project/pull/139822 adds a commit which didn't get backported but is necessary for tests.
301+ (
302+ fetchpatch {
303+ url = "https://github.com/llvm/llvm-project/commit/ff2e8f93f6090965e82d799af43f6dfef52baa66.patch";
304+ stripLen = 1;
305+ hash = "sha256-CZBTZKzi4cYkZhgTB5oXIo1UdEAArg9I4vR/m0upSRk=";
306+ }
307+ );
308309 nativeBuildInputs =
310 [
···15229 lua = lua5_1;
15230 };
1523115232- # solarus and solarus-quest-editor must use the same version of Qt.
15233- solarus = libsForQt5.callPackage ../games/solarus { };
15234- solarus-quest-editor = libsForQt5.callPackage ../development/tools/solarus-quest-editor { };
15235-15236 # You still can override by passing more arguments.
15237 spring = callPackage ../games/spring { asciidoc = asciidoc-full; };
15238
···15229 lua = lua5_1;
15230 };
15231000015232 # You still can override by passing more arguments.
15233 spring = callPackage ../games/spring { asciidoc = asciidoc-full; };
15234