]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - virtual/modules/databases/default.nix
Put some database variables to environment
[perso/Immae/Config/Nix.git] / virtual / modules / databases / default.nix
index 0912830d3ff3b1db561761363532d248aff43087..304ad8923484ad0c9c874ed52616485f10d00062 100644 (file)
@@ -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 {
@@ -151,23 +151,18 @@ in {
       }
     ];
 
-    # Diaspora: 15
-    # Nextcloud: 14
-    # Mastodon: 13
-    # Mediagoblin: 12
-    # wallabag: 0 ?
     services.redis = rec {
       enable = config.services.myDatabases.redis.enable;
       bind = "127.0.0.1";
-      unixSocket = "/run/redis/redis.sock";
+      unixSocket = myconfig.env.databases.redis.socket;
       extraConfig = ''
         unixsocketperm 777
         maxclients 1024
         '';
     };
     system.activationScripts.redis = ''
-      mkdir -p /run/redis
-      chown redis /run/redis
+      mkdir -p $(dirname ${myconfig.env.databases.redis.socket})
+      chown redis $(dirname ${myconfig.env.databases.redis.socket})
     '';
   };
 }