From 3cfb9d074b2ceb7ea6dcbfa2250a29a63f0b04aa Mon Sep 17 00:00:00 2001 From: nixbitcoin Date: Thu, 17 Sep 2020 08:04:23 +0000 Subject: [PATCH] btcpayserver: sqlite -> postgresql --- modules/btcpayserver.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/btcpayserver.nix b/modules/btcpayserver.nix index 6465ab0..ab69837 100644 --- a/modules/btcpayserver.nix +++ b/modules/btcpayserver.nix @@ -93,6 +93,15 @@ in { "d '${cfg.btcpayserver.dataDir}' 0770 ${cfg.btcpayserver.user} ${cfg.btcpayserver.group} - -" ]; + services.postgresql = { + enable = true; + ensureDatabases = [ "btcpaydb" ]; + ensureUsers = [{ + name = "${cfg.btcpayserver.user}"; + ensurePermissions."DATABASE btcpaydb" = "ALL PRIVILEGES"; + }]; + }; + systemd.services.nbxplorer = let configFile = builtins.toFile "config" '' network=mainnet @@ -130,6 +139,7 @@ in { systemd.services.btcpayserver = let configFile = builtins.toFile "config" ('' network=mainnet + postgres=User ID=${cfg.btcpayserver.user};Host=/run/postgresql;Database=btcpaydb socksendpoint=${cfg.tor.client.socksListenAddress} btcexplorerurl=http://${cfg.nbxplorer.bind}:24444/ btcexplorercookiefile=${cfg.nbxplorer.dataDir}/Main/.cookie