From c4c4fcd8a90c9a62bb640f6dc2a14bb11d4ac5f1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 26 Aug 2020 14:07:27 +0200 Subject: SatoshiPay: set up PostgreSQL server --- system/settings/satoshipay.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'system/settings') diff --git a/system/settings/satoshipay.nix b/system/settings/satoshipay.nix index 53384e09..bd5f3202 100644 --- a/system/settings/satoshipay.nix +++ b/system/settings/satoshipay.nix @@ -61,6 +61,30 @@ }; }; + services.postgresql = { + enable = true; + ensureDatabases = ["satoshipay"]; + authentication = '' + # TYPE DATABASE USER ADDRESS METHOD + local all postgres trust + local all all md5 + ''; + ensureUsers = [ + { + name = "alan"; + ensurePermissions = { + "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES"; + }; + } + { + name = "satoshipay"; + ensurePermissions = { + "DATABASE satoshipay" = "ALL PRIVILEGES"; + }; + } + ]; + }; + nix.gc.dates = "12:30"; system.autoUpgrade.dates = "13:05"; -- cgit 1.4.1