From 4de15a4d08bea85f76e475e112b052ce2d416e1e Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Mon, 16 Dec 2024 20:39:49 -0800 Subject: [PATCH] updated synape personalizatoin configuration --- configuration.nix | 18 +++--------------- modules/personalization.nix | 6 +++--- modules/synapse.nix | 2 +- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/configuration.nix b/configuration.nix index 9de3912..be28d42 100755 --- a/configuration.nix +++ b/configuration.nix @@ -292,18 +292,6 @@ in }; }; - - - -###### AGENIX ####### - age.identityPaths = [ "/root/.ssh/agenix/agenix-secret-keys" ]; - - age.secrets.matrix_reg_secret = { - file = /var/lib/agenix-secrets/matrix_reg_secret.age; - mode = "770"; - owner = "matrix-synapse"; - group = "matrix-synapse"; - }; ###### CREATE DATABASE (WORDPRESS, MATRIX_SYNAPSE, AND NEXTCLOUD) ####### @@ -328,14 +316,14 @@ in services.postgresql.initialScript = pkgs.writeText "begin-init.sql" '' - CREATE ROLE "ncusr" WITH LOGIN PASSWORD '${personalization.age.secrets.nextclouddb.file}'; + CREATE ROLE "ncusr" WITH LOGIN PASSWORD '${personalization.nextclouddb}'; CREATE DATABASE "nextclouddb" WITH OWNER "ncusr" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C"; - CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD '${personalization.age.secrets.matrixdb.file}'; + CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD '${personalization.matrixdb}'; CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" @@ -346,7 +334,7 @@ in services.mysql.initialScript = pkgs.writeText "wordpress-init.sql" '' CREATE DATABASE wordpressdb; - GRANT ALL ON *.* TO 'wpusr'@'localhost' IDENTIFIED BY '${personalization.age.secrets.wordpressdb.file}'; + GRANT ALL ON *.* TO 'wpusr'@'localhost' IDENTIFIED BY '${personalization.wordpressdb}'; FLUSH PRIVILEGES; '' ; diff --git a/modules/personalization.nix b/modules/personalization.nix index 6593549..b2f2ca5 100755 --- a/modules/personalization.nix +++ b/modules/personalization.nix @@ -14,9 +14,9 @@ coturn_static_auth_secret = builtins.readFile /var/lib/secrets/turn; ## -age.secrets.matrixdb.file = /var/lib/agenix-secrets/matrixdb.age; -age.secrets.nextclouddb.file = /var/lib/agenix-secrets/nextclouddb.age; -age.secrets.wordpressdb.file = /var/lib/agenix-secrets/wordpressdb.age; +matrixdb = builtins.readFile /var/lib/secrets/matrixdb; +nextclouddb = builtins.readFile /var/lib/secrets/nextclouddb; +wordpressdb = builtins.readFile /var/lib/secrets/wordpressdb; } diff --git a/modules/synapse.nix b/modules/synapse.nix index d633653..d61d66d 100755 --- a/modules/synapse.nix +++ b/modules/synapse.nix @@ -50,7 +50,7 @@ in ]; presence.enabled = true; enable_registration = false; - registration_shared_secret = config.age.secrets.matrix_reg_secret.path; + registration_shared_secret = ${services.matrix-synapse.extraConfigFiles = /var/lib/secrets/matrix_reg_secret}; listeners = [ { port = 8008;