From 3b4f0563d6732a5cf641ada153b42ea9d6ad9977 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Fri, 10 Jun 2022 16:50:07 -0400 Subject: [PATCH] Simple conduit instance --- modules/cloud/conduit/default.nix | 41 +++++++++++++++++++++++++++++++ nki-personal-do/configuration.nix | 3 +++ 2 files changed, 44 insertions(+) create mode 100644 modules/cloud/conduit/default.nix diff --git a/modules/cloud/conduit/default.nix b/modules/cloud/conduit/default.nix new file mode 100644 index 0000000..30b1e50 --- /dev/null +++ b/modules/cloud/conduit/default.nix @@ -0,0 +1,41 @@ +{ pkgs, config, lib, ... }: + +let + cfg = config.cloud.conduit; +in +with lib; +{ + options.cloud.conduit = { + enable = mkEnableOption "Enable the conduit server"; + + host = mkOption { + type = types.str; + default = "m.nkagami.me"; + }; + + port = mkOption { + type = types.int; + default = 6167; + }; + + allow_registration = mkOption { + type = types.bool; + default = false; + }; + }; + + config.services.matrix-conduit = mkIf cfg.enable { + enable = true; + + settings.global = { + inherit (cfg) port allow_registration; + server_name = cfg.host; + database_backend = "rocksdb"; + }; + }; + + config.cloud.traefik.hosts.conduit = mkIf cfg.enable { + inherit (cfg) port host; + }; +} + diff --git a/nki-personal-do/configuration.nix b/nki-personal-do/configuration.nix index 28b690f..42b5e85 100644 --- a/nki-personal-do/configuration.nix +++ b/nki-personal-do/configuration.nix @@ -7,6 +7,7 @@ ../modules/cloud/traefik ../modules/cloud/bitwarden ../modules/cloud/mail + ../modules/cloud/conduit ]; boot.cleanTmpDir = true; @@ -55,6 +56,8 @@ usersFile = config.sops.secrets.traefik-dashboard-users.path; }; cloud.traefik.certsDumper.enable = true; + cloud.conduit.enable = true; + cloud.conduit.allow_registration = true; # Mail sops.secrets.mail-users = { owner = "maddy"; };