]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/peertube/default.nix
Add specification for the private config file as a module.
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / peertube / default.nix
index 6739641fbc5951df92f0a2e027498db2a4459064..0bacfd1ebe48a4292db9c98654dfd3987f4b0b9c 100644 (file)
@@ -1,6 +1,6 @@
-{ lib, pkgs, config, myconfig,  ... }:
+{ lib, pkgs, config,  ... }:
 let
-  env = myconfig.env.tools.peertube;
+  env = config.myEnv.tools.peertube;
   cfg = config.myServices.websites.tools.peertube;
   pcfg = config.services.peertube;
 in {
@@ -27,7 +27,7 @@ in {
       text = ''
         listen:
           hostname: 'localhost'
-          port: ${env.listenPort}
+          port: ${toString config.myEnv.ports.peertube}
         webserver:
           https: true
           hostname: 'peertube.immae.eu'
@@ -45,7 +45,7 @@ in {
         redis:
           socket: '${env.redis.socket}'
           auth: null
-          db: ${env.redis.db_index}
+          db: ${env.redis.db}
         ldap:
           enable: true
           ldap_only: false
@@ -171,13 +171,13 @@ in {
 
           RewriteCond %{REQUEST_URI}  ^/socket.io            [NC]
           RewriteCond %{QUERY_STRING} transport=websocket    [NC]
-          RewriteRule /(.*)           ws://localhost:${env.listenPort}/$1 [P,NE,QSA,L]
+          RewriteRule /(.*)           ws://localhost:${toString env.listenPort}/$1 [P,NE,QSA,L]
 
           RewriteCond %{REQUEST_URI}  ^/tracker/socket       [NC]
-          RewriteRule /(.*)           ws://localhost:${env.listenPort}/$1 [P,NE,QSA,L]
+          RewriteRule /(.*)           ws://localhost:${toString env.listenPort}/$1 [P,NE,QSA,L]
 
-          ProxyPass /        http://localhost:${env.listenPort}/
-          ProxyPassReverse / http://localhost:${env.listenPort}/
+          ProxyPass /        http://localhost:${toString env.listenPort}/
+          ProxyPassReverse / http://localhost:${toString env.listenPort}/
 
           ProxyPreserveHost On
           RequestHeader set X-Real-IP %{REMOTE_ADDR}s