From 3d4317b1c6be94c8a3d2726ef9f7c546fe9ec877 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 25 Jul 2022 18:42:30 +0200 Subject: [PATCH] fixup! lndhub-go: integrate LndHub.go postgres fixup we need to wait until LndHub.go with https://github.com/getAlby/lndhub.go/pull/215 merged in is released --- modules/lndhub-go.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/lndhub-go.nix b/modules/lndhub-go.nix index bd7bf0b00..1d1799aa6 100644 --- a/modules/lndhub-go.nix +++ b/modules/lndhub-go.nix @@ -61,6 +61,8 @@ let postgresql; configFile = builtins.toFile "lndhub-go-conf" (lib.generators.toKeyValue {} cfg.settings); + + dbName = "lndhubgo"; in { inherit options; @@ -74,11 +76,11 @@ in { }; services.postgresql = { enable = true; - ensureDatabases = [ "lndhubgo" ]; + ensureDatabases = [ dbName ]; ensureUsers = [ { name = cfg.user; - ensurePermissions."DATABASE lndhubgo" = "ALL PRIVILEGES"; + ensurePermissions."DATABASE ${dbName}" = "ALL PRIVILEGES"; } ]; }; @@ -86,7 +88,7 @@ in { services.lndhub-go.settings = { HOST = cfg.address; PORT = cfg.port; - DATABASE_URI = "postgresql://${cfg.user}:@localhost:${toString postgresql.port}/lndhubgo?sslmode=disable"; + DATABASE_URI = "unix://${cfg.user}@${dbName}/run/postgresql/.s.PGSQL.${toString postgresql.port}?sslmode=disable"; LND_ADDRESS = "${nbLib.addressWithPort lnd.address lnd.port}"; LND_MACAROON_FILE = "/run/lnd/lndhub-go.macaroon"; LND_CERT_FILE = lnd.certPath;