summaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-10-23 12:45:17 -0400
committertriethyl <triethylammonium@pm.me>2025-10-23 12:45:17 -0400
commitd5de8c8bc833b7dc169027dfd38e94bbbb924d69 (patch)
treefa982246ad77f9de3a1beb9c160fdf6565ad0f12 /nixos
parentcd1e33d6fb4e5237961170e35d10be6ea09e75ee (diff)
homelab: added mattermost module
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/homelab/communications/mattermost.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/homelab/communications/mattermost.nix b/nixos/modules/homelab/communications/mattermost.nix
new file mode 100644
index 0000000..f15002f
--- /dev/null
+++ b/nixos/modules/homelab/communications/mattermost.nix
@@ -0,0 +1,31 @@
+{ config, lib, ... }: let
+ cfg = config.homelab.communications.mattermost;
+ full-domain = lib.strings.concatStrings [cfg.subdomain "." cfg.domain];
+in {
+ options.homelab.communications.mattermost = {
+ enable = lib.mkEnableOption "mattermost";
+ domain = lib.mkOption {
+ description = "The domain under which to serve the mattermost server.";
+ type = lib.types.str;
+ default = config.networking.domain;
+ example = "example.com";
+ };
+ subdomain = lib.mkOption {
+ description = "The subdomain under which to serve the mattermost server.";
+ type = lib.types.str;
+ default = "mattermost";
+ example = "chat";
+ };
+ };
+ config = lib.mkIf cfg.enable {
+ services.mattermost = {
+ enable = true;
+ host = full-domain;
+ siteName = "CompSciClub";
+ dataDir = "/srv/mattermost";
+ };
+ services.caddy.virtualHosts.${full-domain}.extraConfig = ''
+ reverse_proxy http://127.0.0.1:8065 {}
+ '';
+ };
+}