]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Put some database variables to environment
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 24 Jan 2019 18:53:39 +0000 (19:53 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 24 Jan 2019 18:53:39 +0000 (19:53 +0100)
virtual/modules/databases/default.nix
virtual/modules/websites/tools/cloud/nextcloud.nix
virtual/modules/websites/tools/mastodon/mastodon.nix
virtual/modules/websites/tools/tools/wallabag.nix

index 430d032ee42d6d57db2104429eb80d1dea72607a..304ad8923484ad0c9c874ed52616485f10d00062 100644 (file)
@@ -73,7 +73,7 @@ in {
     };
 
     system.activationScripts.postgresql = ''
     };
 
     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 {
       '';
 
     services.postgresql = rec {
index 1cd7b9005bf03d9160922ac0da9cc73f6883f5be..3c6bfc9505e79b209a3c78498d01b0985e2a9e3f 100644 (file)
@@ -105,8 +105,8 @@ let
         'debug' => false,
         'dbtype' => 'pgsql',
         'version' => '15.0.0.10',
         '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}',
         'dbtableprefix' => 'oc_',
         'dbuser' => '${env.postgresql.user}',
         'dbpassword' => '${env.postgresql.password}',
index e6b396bbf927f3b6a738343998f4af5c14c8c31d..770aa2cb5b584cf3157ae92a7116206a4a032c85 100644 (file)
@@ -67,11 +67,11 @@ let
     REDIS_HOST=${env.redis.host}
     REDIS_PORT=${env.redis.port}
     REDIS_DB=${env.redis.db}
     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_PASS=${env.postgresql.password}
-    DB_PORT=5432
+    DB_PORT=${env.postgresql.port}
 
     LOCAL_DOMAIN=mastodon.immae.eu
     LOCAL_HTTPS=true
 
     LOCAL_DOMAIN=mastodon.immae.eu
     LOCAL_HTTPS=true
index e708e8c29ebaa0085592220e7f88a4eb0ffebad4..4bda8089a5d3df7c196a25e4f5f71209478defaf 100644 (file)
@@ -7,10 +7,10 @@ let
       parameters:
           database_driver: pdo_pgsql
           database_driver_class: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
       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_
           database_password: ${env.postgresql.password}
           database_path: null
           database_table_prefix: wallabag_