|
|
|
@ -656,7 +656,12 @@ in |
|
|
|
|
long_polling_interval = null; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
services.redis.enable = lib.mkDefault (cfg.redis.host == "localhost"); |
|
|
|
|
services.redis.servers.discourse = |
|
|
|
|
lib.mkIf (lib.elem cfg.redis.host [ "localhost" "127.0.0.1" ]) { |
|
|
|
|
enable = true; |
|
|
|
|
bind = cfg.redis.host; |
|
|
|
|
port = cfg.backendSettings.redis_port; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
services.postgresql = lib.mkIf databaseActuallyCreateLocally { |
|
|
|
|
enable = true; |
|
|
|
@ -697,12 +702,12 @@ in |
|
|
|
|
systemd.services.discourse = { |
|
|
|
|
wantedBy = [ "multi-user.target" ]; |
|
|
|
|
after = [ |
|
|
|
|
"redis.service" |
|
|
|
|
"redis-discourse.service" |
|
|
|
|
"postgresql.service" |
|
|
|
|
"discourse-postgresql.service" |
|
|
|
|
]; |
|
|
|
|
bindsTo = [ |
|
|
|
|
"redis.service" |
|
|
|
|
"redis-discourse.service" |
|
|
|
|
] ++ lib.optionals (cfg.database.host == null) [ |
|
|
|
|
"postgresql.service" |
|
|
|
|
"discourse-postgresql.service" |
|
|
|
|