From 8393821a8d47392c2b29c796efead25becb6c455 Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Mon, 16 Dec 2024 19:12:06 -0800 Subject: [PATCH] updated agenix system --- configuration.nix | 12 ++++++++---- modules/personalization.nix | 8 -------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/configuration.nix b/configuration.nix index 8aef595..3249ef7 100755 --- a/configuration.nix +++ b/configuration.nix @@ -304,7 +304,11 @@ in owner = "matrix-synapse"; group = "matrix-synapse"; }; - + + age.secrets.matrix_reg_secret.file = /var/lib/agenix-secrets/matrix_reg_secret.age; + 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; ###### CREATE DATABASE (WORDPRESS, MATRIX_SYNAPSE, AND NEXTCLOUD) ####### @@ -329,14 +333,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 '${age.secrets.nextclouddb.file}'; 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 '${age.secrets.matrixdb.file}'; CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" @@ -347,7 +351,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 '${age.secrets.wordpressdb.file}'; FLUSH PRIVILEGES; '' ; diff --git a/modules/personalization.nix b/modules/personalization.nix index 544df7f..a582437 100755 --- a/modules/personalization.nix +++ b/modules/personalization.nix @@ -12,13 +12,5 @@ vaultwarden_url = builtins.readFile /var/lib/domains/vaultwarden; external_ip_secret = builtins.readFile /var/lib/secrets/external_ip; coturn_static_auth_secret = builtins.readFile /var/lib/secrets/turn; -## - -age.secrets.matrix_reg_secret.file = /var/lib/agenix-secrets/matrix_reg_secret.age; -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; - - }