Compare commits
1 commit
1662420bdc
...
1912025dca
Author | SHA1 | Date | |
---|---|---|---|
Dmitry Voronin | 1912025dca |
57
container/Chat.nix
Normal file
57
container/Chat.nix
Normal file
|
@ -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;
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue