Skip to content

Commit

Permalink
fixup! lndhub-go: integrate LndHub.go
Browse files Browse the repository at this point in the history
postgres fixup

we need to wait until LndHub.go with getAlby/lndhub.go#215 merged in is released
  • Loading branch information
prusnak committed Jul 25, 2022
1 parent e1171b6 commit 3d4317b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/lndhub-go.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ let
postgresql;

configFile = builtins.toFile "lndhub-go-conf" (lib.generators.toKeyValue {} cfg.settings);

dbName = "lndhubgo";
in {
inherit options;

Expand All @@ -74,19 +76,19 @@ in {
};
services.postgresql = {
enable = true;
ensureDatabases = [ "lndhubgo" ];
ensureDatabases = [ dbName ];
ensureUsers = [
{
name = cfg.user;
ensurePermissions."DATABASE lndhubgo" = "ALL PRIVILEGES";
ensurePermissions."DATABASE ${dbName}" = "ALL PRIVILEGES";
}
];
};

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;
Expand Down

0 comments on commit 3d4317b

Please sign in to comment.