diff --git a/container/Chat.nix b/container/Chat.nix new file mode 100644 index 0000000..8bf839f --- /dev/null +++ b/container/Chat.nix @@ -0,0 +1,57 @@ +{ + container, + lib, + config, + ... +}: +let + cfg = config.container.module.chat; +in +{ + options = { + container.module.chat = { + enable = lib.mkEnableOption "chat container."; + address = lib.mkOption { + default = "10.1.0.20"; + type = lib.types.str; + }; + port = lib.mkOption { + default = 80; + type = lib.types.int; + }; + domain = lib.mkOption { + default = "chat.${config.container.domain}"; + type = lib.types.str; + }; + storage = lib.mkOption { + default = "${config.container.storage}/chat"; + type = lib.types.str; + }; + }; + }; + + # WIP: https://search.nixos.org/options?channel=24.05&from=0&size=50&sort=relevance&type=packages&query=mattermost + config = lib.mkIf cfg.enable { + systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ]; + + containers.chat = container.mkContainer cfg { + bindMounts = { + # "/var/lib/changedetection-io" = { + # hostPath = "${cfg.storage}/data"; + # isReadOnly = false; + # }; + }; + + config = + { ... }: + container.mkContainerConfig cfg { + # services.changedetection-io = { + # enable = true; + # baseURL = cfg.domain; + # behindProxy = true; + # listenAddress = cfg.address; + # }; + }; + }; + }; +}