about summary refs log tree commit diff
path: root/modules/services/matrix-moderation.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-01-24 19:18:11 +0900
committersefidel <contact@sefidel.net>2024-01-24 19:18:11 +0900
commit497c3cd7864fdbcc546408d6d86ebfad37aa9b78 (patch)
tree6cd5bf30b9953156d71192fa96e34a863dda5926 /modules/services/matrix-moderation.nix
parenta1dc1ff8c07155f697a30145168820612b28b6cd (diff)
downloadinfra-497c3cd7864fdbcc546408d6d86ebfad37aa9b78.tar.gz
infra-497c3cd7864fdbcc546408d6d86ebfad37aa9b78.zip
wip: try to use infra-modules infra-modules
Diffstat (limited to 'modules/services/matrix-moderation.nix')
-rw-r--r--modules/services/matrix-moderation.nix58
1 files changed, 0 insertions, 58 deletions
diff --git a/modules/services/matrix-moderation.nix b/modules/services/matrix-moderation.nix
deleted file mode 100644
index b44cdf3..0000000
--- a/modules/services/matrix-moderation.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-{ config, lib, ... }:
-
-# TODO: rename
-
-with lib;
-let
-  cfg = config.modules.services.matrix-moderation;
-in
-{
-  options.modules.services.matrix-moderation = {
-    enable = mkEnableOption "matrix-moderation";
-    domain = mkOption { type = types.str; };
-    realHost = mkOption { type = types.str; default = "matrix.${cfg.domain}"; };
-    secrets.userPassword = mkOption { type = types.str; description = "path to the mjolnir password"; };
-  };
-
-  config = mkIf cfg.enable {
-    services.mjolnir = {
-      enable = true;
-      homeserverUrl = "http://127.0.0.1:8008";
-      pantalaimon.enable = true;
-      # NOTE: this option currently has no effect
-      pantalaimon.options = {
-        listenAddress = "127.0.0.1";
-        listenPort = 8011;
-      };
-      pantalaimon.username = "abuse";
-      pantalaimon.passwordFile = cfg.secrets.userPassword;
-      managementRoom = "#moderation:${cfg.domain}";
-
-      settings = {
-        # TODO: get rid of hardcoded values
-        homeserverUrl = "http://127.0.0.1:8011";
-        automaticallyRedactForReasons = [
-          "spam"
-          "advertising"
-          "unwanted"
-        ];
-      };
-    };
-
-    # TODO: get rid of hardcoded values
-    systemd.services.mjolnir.after = [ "matrix-synapse.service" ];
-
-    # Override the pantalaimon options, since the mjolnir one is broken
-    services.pantalaimon-headless.instances."mjolnir" = {
-      listenAddress = "127.0.0.1";
-      listenPort = 8011;
-    };
-
-    services.matrix-synapse.plugins = with config.services.matrix-synapse.package.plugins; [ matrix-synapse-mjolnir-antispam ];
-
-    modules.persistence.directories = [
-      "/var/lib/private/pantalaimon-mjolnir"
-      "/var/lib/mjolnir"
-    ];
-  };
-}