From 96c60c6b09322a6aae67dd3df83aadeffe1959ab Mon Sep 17 00:00:00 2001 From: Ricardo Band Date: Sun, 30 Jun 2024 20:25:43 +0200 Subject: [PATCH] nixos/freshrss: add ability to use socket path This change enables server:port combinations like "localhost:5432" but also socket paths like "/run/postgresql". Without this change a port was mendatory and attached to the path (/run/postgresql:5432) resulting in an incorrect socket path. The underlying script already configures paths correctly, so this small change should be enough. --- nixos/modules/services/web-apps/freshrss.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/services/web-apps/freshrss.nix b/nixos/modules/services/web-apps/freshrss.nix index 021101fecaa4..5a16328ddaaf 100644 --- a/nixos/modules/services/web-apps/freshrss.nix +++ b/nixos/modules/services/web-apps/freshrss.nix @@ -249,7 +249,10 @@ in ${if cfg.database.passFile != null then "--db-password" else null} = ''"$(cat ${cfg.database.passFile})"''; ${if cfg.database.user != null then "--db-user" else null} = ''"${cfg.database.user}"''; ${if cfg.database.tableprefix != null then "--db-prefix" else null} = ''"${cfg.database.tableprefix}"''; + # hostname:port e.g. "localhost:5432" ${if cfg.database.host != null && cfg.database.port != null then "--db-host" else null} = ''"${cfg.database.host}:${toString cfg.database.port}"''; + # socket path e.g. "/run/postgresql" + ${if cfg.database.host != null && cfg.database.port == null then "--db-host" else null} = ''"${cfg.database.host}"''; }); in {