From: Ismaƫl Bouya Date: Thu, 24 Jan 2019 18:53:39 +0000 (+0100) Subject: Put some database variables to environment X-Git-Tag: nur_publish~294 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=6f4574e7b57043340a2a520c4bbeb17dde72e0ea Put some database variables to environment --- diff --git a/virtual/modules/databases/default.nix b/virtual/modules/databases/default.nix index 430d032..304ad89 100644 --- a/virtual/modules/databases/default.nix +++ b/virtual/modules/databases/default.nix @@ -73,7 +73,7 @@ in { }; system.activationScripts.postgresql = '' - install -m 0755 -o postgres -g postgres -d /run/postgresql + install -m 0755 -o postgres -g postgres -d ${myconfig.env.databases.postgresql.socket} ''; services.postgresql = rec { diff --git a/virtual/modules/websites/tools/cloud/nextcloud.nix b/virtual/modules/websites/tools/cloud/nextcloud.nix index 1cd7b90..3c6bfc9 100644 --- a/virtual/modules/websites/tools/cloud/nextcloud.nix +++ b/virtual/modules/websites/tools/cloud/nextcloud.nix @@ -105,8 +105,8 @@ let 'debug' => false, 'dbtype' => 'pgsql', 'version' => '15.0.0.10', - 'dbname' => 'webapps', - 'dbhost' => '/run/postgresql', + 'dbname' => '${env.postgresql.database}', + 'dbhost' => '${env.postgresql.socket}', 'dbtableprefix' => 'oc_', 'dbuser' => '${env.postgresql.user}', 'dbpassword' => '${env.postgresql.password}', diff --git a/virtual/modules/websites/tools/mastodon/mastodon.nix b/virtual/modules/websites/tools/mastodon/mastodon.nix index e6b396b..770aa2c 100644 --- a/virtual/modules/websites/tools/mastodon/mastodon.nix +++ b/virtual/modules/websites/tools/mastodon/mastodon.nix @@ -67,11 +67,11 @@ let REDIS_HOST=${env.redis.host} REDIS_PORT=${env.redis.port} REDIS_DB=${env.redis.db} - DB_HOST=/run/postgresql - DB_USER=mastodon - DB_NAME=mastodon + DB_HOST=${env.postgresql.socket} + DB_USER=${env.postgresql.user} + DB_NAME=${env.postgresql.database} DB_PASS=${env.postgresql.password} - DB_PORT=5432 + DB_PORT=${env.postgresql.port} LOCAL_DOMAIN=mastodon.immae.eu LOCAL_HTTPS=true diff --git a/virtual/modules/websites/tools/tools/wallabag.nix b/virtual/modules/websites/tools/tools/wallabag.nix index e708e8c..4bda808 100644 --- a/virtual/modules/websites/tools/tools/wallabag.nix +++ b/virtual/modules/websites/tools/tools/wallabag.nix @@ -7,10 +7,10 @@ let parameters: database_driver: pdo_pgsql database_driver_class: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver - database_host: db-1.immae.eu - database_port: null - database_name: webapps - database_user: wallabag + database_host: ${env.postgresql.socket} + database_port: ${env.postgresql.port} + database_name: ${env.postgresql.database} + database_user: ${env.postgresql.user} database_password: ${env.postgresql.password} database_path: null database_table_prefix: wallabag_