From 35e75ee0c2e151c7930df595e360e6df0ec7754c Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 8 Oct 2022 07:03:58 -0400 Subject: Add bridge postgresql database on dragon --- modules/bridge.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 modules/bridge.nix (limited to 'modules/bridge.nix') diff --git a/modules/bridge.nix b/modules/bridge.nix new file mode 100644 index 0000000..b8601e8 --- /dev/null +++ b/modules/bridge.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.orbekk.bridge; +in +with lib; +{ + options = { + orbekk.bridge = { + enable = mkEnableOption "Enable bridge service"; + }; + }; + + config = mkIf cfg.enable { + services.postgresq = { + enable = true; + ensureDatabases = [ "bridge-nightly" ]; + ensureUsers = [ + { + name = "bridge-nightly"; + ensurePermissions."DATABASE bridge-nightly" = "ALL PRIVILEGES"; + } + ]; + }; + }; +}; -- cgit v1.2.3