mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-02-04 09:10:01 +01:00
bicep/matrix: use sops templates to render structured files
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
{ config, lib, fp, pkgs, secrets, values, ... }:
|
||||
|
||||
{
|
||||
sops.secrets."matrix/synapse/turnconfig" = {
|
||||
sopsFile = fp /secrets/bicep/matrix.yaml;
|
||||
key = "synapse/turnconfig";
|
||||
owner = config.users.users.matrix-synapse.name;
|
||||
group = config.users.users.matrix-synapse.group;
|
||||
restartUnits = [ "coturn.service" ];
|
||||
};
|
||||
sops.secrets."matrix/coturn/static-auth-secret" = {
|
||||
sopsFile = fp /secrets/bicep/matrix.yaml;
|
||||
key = "coturn/static-auth-secret";
|
||||
@@ -16,9 +9,18 @@
|
||||
restartUnits = [ "coturn.service" ];
|
||||
};
|
||||
|
||||
sops.templates."matrix-synapse-turnconfig" = {
|
||||
owner = config.users.users.matrix-synapse.name;
|
||||
group = config.users.users.matrix-synapse.group;
|
||||
content = ''
|
||||
turn_shared_secret: ${config.sops.placeholder."matrix/coturn/static-auth-secret"}
|
||||
'';
|
||||
restartUnits = [ "matrix-synapse.target" ];
|
||||
};
|
||||
|
||||
services.matrix-synapse-next = {
|
||||
extraConfigFiles = [
|
||||
config.sops.secrets."matrix/synapse/turnconfig".path
|
||||
config.sops.templates."matrix-synapse-turnconfig".path
|
||||
];
|
||||
|
||||
settings = {
|
||||
|
||||
@@ -15,11 +15,16 @@ in {
|
||||
group = config.users.users.matrix-synapse.group;
|
||||
};
|
||||
|
||||
sops.secrets."matrix/synapse/user_registration" = {
|
||||
sops.secrets."matrix/synapse/user_registration/registration_shared_secret" = {
|
||||
sopsFile = fp /secrets/bicep/matrix.yaml;
|
||||
key = "synapse/signing_key";
|
||||
key = "synapse/user_registration/registration_shared_secret";
|
||||
};
|
||||
sops.templates."matrix-synapse-user-registration" = {
|
||||
owner = config.users.users.matrix-synapse.name;
|
||||
group = config.users.users.matrix-synapse.group;
|
||||
content = ''
|
||||
registration_shared_secret: ${config.sops.placeholder."matrix/synapse/user_registration/registration_shared_secret"}
|
||||
'';
|
||||
};
|
||||
|
||||
services.matrix-synapse-next = {
|
||||
@@ -83,7 +88,7 @@ in {
|
||||
mau_stats_only = true;
|
||||
|
||||
enable_registration = false;
|
||||
registration_shared_secret_path = config.sops.secrets."matrix/synapse/user_registration".path;
|
||||
registration_shared_secret_path = config.sops.templates."matrix-synapse-user-registration".path;
|
||||
|
||||
password_config.enabled = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user