summaryrefslogtreecommitdiff
path: root/os/kay/modules/matrix
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-06-10 15:55:54 +0530
committersinanmohd <sinan@sinanmohd.com>2025-06-10 22:55:04 +0530
commita41037ef644dbacb3d577933fb3d93c210439b38 (patch)
treea262750bcb1357785ad8cb68b232a5ca242ee671 /os/kay/modules/matrix
parentcfccbd1e4026d568e23a47c060ae3ae042cceb4c (diff)
chore(repo): reformat with nixfmt-rfc-style
Diffstat (limited to 'os/kay/modules/matrix')
-rw-r--r--os/kay/modules/matrix/default.nix8
-rw-r--r--os/kay/modules/matrix/dendrite.nix50
-rw-r--r--os/kay/modules/matrix/matrix-sliding-sync.nix33
3 files changed, 58 insertions, 33 deletions
diff --git a/os/kay/modules/matrix/default.nix b/os/kay/modules/matrix/default.nix
index f81d0d9..1b9564d 100644
--- a/os/kay/modules/matrix/default.nix
+++ b/os/kay/modules/matrix/default.nix
@@ -1,12 +1,14 @@
-{ config, ... }: let
+{ config, ... }:
+let
domain = config.global.userdata.domain;
-in {
+in
+{
imports = [
./dendrite.nix
./matrix-sliding-sync.nix
];
- sops.secrets."matrix-${domain}/sliding_sync" = {};
+ sops.secrets."matrix-${domain}/sliding_sync" = { };
services.matrix-sliding-sync-dirty = {
enable = true;
diff --git a/os/kay/modules/matrix/dendrite.nix b/os/kay/modules/matrix/dendrite.nix
index 3f4a879..e66c5a5 100644
--- a/os/kay/modules/matrix/dendrite.nix
+++ b/os/kay/modules/matrix/dendrite.nix
@@ -10,16 +10,18 @@ let
};
in
{
- sops.secrets."matrix-${domain}/key" = {};
+ sops.secrets."matrix-${domain}/key" = { };
systemd.services.dendrite.after = [ "postgresql.service" ];
services = {
postgresql = {
ensureDatabases = [ "dendrite" ];
- ensureUsers = [{
- name = "dendrite";
- ensureDBOwnership = true;
- }];
+ ensureUsers = [
+ {
+ name = "dendrite";
+ ensureDBOwnership = true;
+ }
+ ];
};
dendrite = {
@@ -43,10 +45,12 @@ in
];
inherit database;
};
- logging = [{
- type = "std";
- level = "warn";
- }];
+ logging = [
+ {
+ type = "std";
+ level = "warn";
+ }
+ ];
mscs = {
inherit database;
mscs = [ "msc2836" ];
@@ -63,19 +67,21 @@ in
federation_api = {
inherit database;
send_max_retries = 8;
- key_perspectives = [{
- server_name = "matrix.org";
- keys = [
- {
- key_id = "ed25519:auto";
- public_key = "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw";
- }
- {
- key_id = "ed25519:a_RXGa";
- public_key = "l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ";
- }
- ];
- }];
+ key_perspectives = [
+ {
+ server_name = "matrix.org";
+ keys = [
+ {
+ key_id = "ed25519:auto";
+ public_key = "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw";
+ }
+ {
+ key_id = "ed25519:a_RXGa";
+ public_key = "l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ";
+ }
+ ];
+ }
+ ];
};
app_service_api = {
diff --git a/os/kay/modules/matrix/matrix-sliding-sync.nix b/os/kay/modules/matrix/matrix-sliding-sync.nix
index f4c1426..63d95ad 100644
--- a/os/kay/modules/matrix/matrix-sliding-sync.nix
+++ b/os/kay/modules/matrix/matrix-sliding-sync.nix
@@ -1,12 +1,20 @@
-{ config, lib, pkgs, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
let
cfg = config.services.matrix-sliding-sync-dirty;
- matrix-sliding-sync = pkgs.callPackage ../../pkgs/matrix-sliding-sync.nix {};
+ matrix-sliding-sync = pkgs.callPackage ../../pkgs/matrix-sliding-sync.nix { };
in
{
imports = [
- (lib.mkRenamedOptionModule [ "services" "matrix-synapse" "sliding-sync" ] [ "services" "matrix-sliding-sync" ])
+ (lib.mkRenamedOptionModule
+ [ "services" "matrix-synapse" "sliding-sync" ]
+ [ "services" "matrix-sliding-sync" ]
+ )
];
options.services.matrix-sliding-sync-dirty = {
@@ -40,7 +48,14 @@ in
};
SYNCV3_LOG_LEVEL = lib.mkOption {
- type = lib.types.enum [ "trace" "debug" "info" "warn" "error" "fatal" ];
+ type = lib.types.enum [
+ "trace"
+ "debug"
+ "info"
+ "warn"
+ "error"
+ "fatal"
+ ];
default = "info";
description = "The level of verbosity for messages logged.";
};
@@ -77,10 +92,12 @@ in
services.postgresql = lib.optionalAttrs cfg.createDatabase {
enable = true;
ensureDatabases = [ "matrix-sliding-sync" ];
- ensureUsers = [ {
- name = "matrix-sliding-sync";
- ensureDBOwnership = true;
- } ];
+ ensureUsers = [
+ {
+ name = "matrix-sliding-sync";
+ ensureDBOwnership = true;
+ }
+ ];
};
systemd.services.matrix-sliding-sync = rec {