diff options
-rw-r--r-- | modules/bridge.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/bridge.nix b/modules/bridge.nix index e26ba73..efc4b92 100644 --- a/modules/bridge.nix +++ b/modules/bridge.nix @@ -7,10 +7,39 @@ with lib; options = { orbekk.bridge = { enable = mkEnableOption "Enable bridge service"; + + port = lib.mkOption { + type = lib.types.port; + default = 40421; + description = "bridge local port"; + }; }; }; config = mkIf cfg.enable { + services.bridge-nightly = { + description = "Bridge Nightly backend"; + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + + environment = { + BIND_ADDRESS = "[::]:${cfg.port}"; + RUST_BACKTRACE = "1"; + AUTHENTICATOR = "oauth"; + OPENID_ISSUER_URL= "https://auth.orbekk.com/realms/test"; + OPENID_CLIENT_ID= "test-client"; + OPENID_CLIENT_SECRET= "secret"; + APP_URL = "https://bridge-nightly.orbekk.com"; + DATABASE_URL = "postgres:///bridge_nightly"; + }; + + serviceConfig = { + User = "bridge_nightly"; + Group = "bridge_nightly"; + ExecStart = "/opt/bridge-nightly/profile/bin/server"; + }; + }; + services.postgresql = { enable = true; enableTCPIP = true; |