summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--machines/dragon.nix1
-rw-r--r--modules/bridge.nix25
2 files changed, 26 insertions, 0 deletions
diff --git a/machines/dragon.nix b/machines/dragon.nix
index 5a3aa91..d7dc80e 100644
--- a/machines/dragon.nix
+++ b/machines/dragon.nix
@@ -16,6 +16,7 @@ in {
orbekk.backups.enableServer = true;
orbekk.backups.enableClient = true;
orbekk.vpn.enable = true;
+ orbekk.bridge.enable = true;
environment.systemPackages = with pkgs; [ ipmitool ];
programs.mosh.enable = true;
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";
+ }
+ ];
+ };
+ };
+};