about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorckie <git-525ff67@ckie.dev>2024-01-01 21:41:59 +0200
committerckie <git-525ff67@ckie.dev>2024-04-24 22:45:37 +0300
commitbdde259862873eaab23d1b69565e93eafb3b6d73 (patch)
tree980c8641c0cdc70109d92ec83c59b4c62a64535c /nixos/modules
parentcfc3698c31b1fb9cdcf10f36c9643460264d0ca8 (diff)
nixos/roundcube: eliminate extra postgres package for local databases
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/mail/roundcube.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/modules/services/mail/roundcube.nix b/nixos/modules/services/mail/roundcube.nix
index c35ece8362f67..e949bf283ba32 100644
--- a/nixos/modules/services/mail/roundcube.nix
+++ b/nixos/modules/services/mail/roundcube.nix
@@ -228,13 +228,14 @@ in
       (mkIf (cfg.database.host == "localhost") {
         requires = [ "postgresql.service" ];
         after = [ "postgresql.service" ];
-        path = [ config.services.postgresql.package ];
       })
       {
         after = [ "network-online.target" ];
         wantedBy = [ "multi-user.target" ];
+
+        path = [ config.services.postgresql.package ];
         script = let
-          psql = "${lib.optionalString (!localDB) "PGPASSFILE=${cfg.database.passwordFile}"} ${pkgs.postgresql}/bin/psql ${lib.optionalString (!localDB) "-h ${cfg.database.host} -U ${cfg.database.username} "} ${cfg.database.dbname}";
+          psql = "${lib.optionalString (!localDB) "PGPASSFILE=${cfg.database.passwordFile}"} psql ${lib.optionalString (!localDB) "-h ${cfg.database.host} -U ${cfg.database.username} "} ${cfg.database.dbname}";
         in
         ''
           version="$(${psql} -t <<< "select value from system where name = 'roundcube-version';" || true)"