Compare commits
3 Commits
10b6622997
...
8a62d11409
Author | SHA1 | Date | |
---|---|---|---|
8a62d11409
|
|||
e82d1cac63
|
|||
734359da5b
|
54
flake.lock
generated
54
flake.lock
generated
@@ -108,11 +108,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720661479,
|
"lastModified": 1721007199,
|
||||||
"narHash": "sha256-nsGgA14vVn0GGiqEfomtVgviRJCuSR3UEopfP8ixW1I=",
|
"narHash": "sha256-Gof4Lj1rgTrX59bNu5b/uS/3X/marUGM7LYw31NoXEA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "786965e1b1ed3fd2018d78399984f461e2a44689",
|
"rev": "bad376945de7033c7adc424c02054ea3736cf7c4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -252,11 +252,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720450253,
|
"lastModified": 1721038330,
|
||||||
"narHash": "sha256-1in42htN3g3MnE3/AO5Qgs6pMWUzmtPQ7s675brO8uw=",
|
"narHash": "sha256-DyIGJ+DEnKeGd346YJCwjmp9hXwiYq8wqGtikgbDqSc=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "2b6bd3c87d3a66fb0b8f2f06c985995e04b4fb96",
|
"rev": "622291c026190caf13cb26f5136616b1ff0a07aa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -392,11 +392,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720337362,
|
"lastModified": 1720845312,
|
||||||
"narHash": "sha256-9TNQtlwu97NPaJYsKkdObOsy0MLN4NAOBz0pqwH3KnA=",
|
"narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "0f89b73f41eaa1dde67b291452c181d9a75f10dd",
|
"rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -478,11 +478,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720768451,
|
"lastModified": 1720957393,
|
||||||
"narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=",
|
"narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9",
|
"rev": "693bc46d169f5af9c992095736e82c3488bf7dbb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -509,11 +509,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720823163,
|
"lastModified": 1720954236,
|
||||||
"narHash": "sha256-FZ5dnrvKkln9ESdoTR8R7GKW9rNpXNZrxGsOXsbsTpE=",
|
"narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f12ee5f64c6a09995e71c9626d88c4efa983b488",
|
"rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -536,11 +536,11 @@
|
|||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720472744,
|
"lastModified": 1721045803,
|
||||||
"narHash": "sha256-BJf06/uE8XgjSqXB6ftabinqK+qaAmWA0dLxAfLrAjw=",
|
"narHash": "sha256-dQGvOK+t45unF7DTp5bfO37hY0NkDUw6X3MH5CCTEAs=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "2c52164a4f1b863f5eda842b4b9423b7f2677ddc",
|
"rev": "eef2f4c6b190d92e296e47e5fe10e7ced65fd959",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -560,11 +560,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720896694,
|
"lastModified": 1720992717,
|
||||||
"narHash": "sha256-lKInIpVIrI4YOTwbaN6wwQ+EvhL/iVqKhpxcTj4kBhE=",
|
"narHash": "sha256-8j1bZVfKT1vJ0e+U7NYRNBG+DdBj5C/tpwe5krxT4/4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "plasma-manager",
|
"repo": "plasma-manager",
|
||||||
"rev": "809d86d6a8a48b6d71b6ece05eeb5e55f554b396",
|
"rev": "460b48dc3dcd05df568e27cbb90581d23baec8dc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -671,11 +671,11 @@
|
|||||||
"thunderbird-gnome-theme": {
|
"thunderbird-gnome-theme": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720932823,
|
"lastModified": 1720976955,
|
||||||
"narHash": "sha256-PGVH1Tw4M+6p1ShyDDxWH6VYlWh4SM8Omxo/zoSC3G8=",
|
"narHash": "sha256-zW04svPauvuC2Jc8vlDGNW4ak1TkISb3r3tLOvMPVvc=",
|
||||||
"owner": "rafaelmardojai",
|
"owner": "rafaelmardojai",
|
||||||
"repo": "thunderbird-gnome-theme",
|
"repo": "thunderbird-gnome-theme",
|
||||||
"rev": "8641c999d3ae48da638ff597faba1da816ca5fc0",
|
"rev": "8d022af89a8e2014bdf658ada5b0f0f2b6fcd71f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -692,11 +692,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720436211,
|
"lastModified": 1720930114,
|
||||||
"narHash": "sha256-/cKXod0oGLl+vH4bKBZnTV3qxrw4jgOLnyQ8KXey5J8=",
|
"narHash": "sha256-VZK73b5hG5bSeAn97TTcnPjXUXtV7j/AtS4KN8ggCS0=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "6fc8bded78715cdd43a3278a14ded226eb3a239e",
|
"rev": "b92afa1501ac73f1d745526adc4f89b527595f14",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@@ -28,7 +28,7 @@ in {
|
|||||||
default = [];
|
default = [];
|
||||||
apply = bridges:
|
apply = bridges:
|
||||||
if lib.all (bridge: lib.elem bridge validBridges) bridges
|
if lib.all (bridge: lib.elem bridge validBridges) bridges
|
||||||
then bridges
|
then lib.map (b: "mautrix-${b}") bridges
|
||||||
else throw "Invalid bridge(s) specified. Valid bridges are: ${lib.concatStringsSep ", " validBridges}";
|
else throw "Invalid bridge(s) specified. Valid bridges are: ${lib.concatStringsSep ", " validBridges}";
|
||||||
};
|
};
|
||||||
serverName = lib.mkOption {
|
serverName = lib.mkOption {
|
||||||
@@ -43,11 +43,15 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
|
mkBridgeDatabase = bridge: {
|
||||||
|
name = bridge;
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
};
|
||||||
commonBridgeSettings = bridge: {
|
commonBridgeSettings = bridge: {
|
||||||
appservice = {
|
appservice = {
|
||||||
database = lib.mkIf cfg.usePostgresql {
|
database = lib.mkIf cfg.usePostgresql {
|
||||||
type = "postgres";
|
type = "postgres";
|
||||||
uri = "postgresql:///mautrix-${bridge}?host=/run/postgresql";
|
uri = "postgresql:///${bridge}?host=/run/postgresql";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
bridge = {
|
bridge = {
|
||||||
@@ -163,6 +167,7 @@ in {
|
|||||||
|
|
||||||
services.matrix-synapse = {
|
services.matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableRegistrationScript = true;
|
||||||
settings = {
|
settings = {
|
||||||
database.name = (if cfg.usePostgresql then "psycopg2" else "sqlite3");
|
database.name = (if cfg.usePostgresql then "psycopg2" else "sqlite3");
|
||||||
enable_metrics = false;
|
enable_metrics = false;
|
||||||
@@ -179,18 +184,18 @@ in {
|
|||||||
name = "matrix-synapse";
|
name = "matrix-synapse";
|
||||||
ensureDBOwnership = true;
|
ensureDBOwnership = true;
|
||||||
}
|
}
|
||||||
];
|
] ++ lib.map mkBridgeDatabase cfg.bridges;
|
||||||
ensureDatabases = [
|
ensureDatabases = [
|
||||||
"matrix-synapse"
|
"matrix-synapse"
|
||||||
];
|
] ++ cfg.bridges;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.mautrix-signal = lib.mkIf (lib.elem "signal" cfg.bridges) {
|
services.mautrix-signal = lib.mkIf (lib.elem "mautrix-signal" cfg.bridges) {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = commonBridgeSettings "signal";
|
settings = commonBridgeSettings "mautrix-signal";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.mautrix-whatsapp = lib.mkIf (lib.elem "whatsapp" cfg.bridges) {
|
services.mautrix-whatsapp = lib.mkIf (lib.elem "mautrix-whatsapp" cfg.bridges) {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
bridge = {
|
bridge = {
|
||||||
@@ -202,7 +207,7 @@ in {
|
|||||||
};
|
};
|
||||||
mute_bridging = true;
|
mute_bridging = true;
|
||||||
};
|
};
|
||||||
} // commonBridgeSettings "whatsapp";
|
} // commonBridgeSettings "mautrix-whatsapp";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user