diff --git a/options/custom/containers/conduwuit.nix b/options/custom/containers/conduwuit.nix new file mode 100644 index 0000000..d074017 --- /dev/null +++ b/options/custom/containers/conduwuit.nix @@ -0,0 +1,42 @@ +{ + config, + inputs, + lib, + ... +}: +with lib; let + cfg = config.custom.containers.conduwuit; +in { + options.custom.containers.conduwuit.enable = mkOption {default = false;}; + + config = mkIf cfg.enable { + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; + }; + in { + "${config.custom.profile}/conduwuit/conduwuit.toml" = secret "${config.custom.profile}/conduwuit/conduwuit.toml"; + }; + + #?? arion-conduwuit pull + environment.shellAliases.arion-conduwuit = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.conduwuit.settings.out.dockerComposeYaml}"; + + virtualisation.arion.projects.conduwuit.settings.services = { + conduwuit.service = { + container_name = "conduwuit"; + image = "girlbossceo/conduwuit:main"; + ports = ["127.0.0.1:6167:6167"]; + restart = "unless-stopped"; + + environment = { + CONDUWUIT_CONFIG = "/etc/conduwuit/conduwuit.toml"; + }; + + volumes = [ + "${config.custom.containers.directory}/conduwuit/db:/var/lib/conduwuit" + "${config.age.secrets."${config.custom.profile}/conduwuit/conduwuit.toml".path}:/etc/conduwuit/conduwuit.toml" + ]; + }; + }; + }; +} diff --git a/profiles/server/default.nix b/profiles/server/default.nix index b9a4e1d..eab86cc 100644 --- a/profiles/server/default.nix +++ b/profiles/server/default.nix @@ -7,6 +7,7 @@ enable = true; boot = true; #// actualbudget.enable = true; + conduwuit.enable = true; coturn.enable = true; forgejo.enable = true; foundryvtt.enable = true; @@ -20,7 +21,7 @@ services = { caddy.enable = true; - matrix-conduit.enable = true; + #// matrix-conduit.enable = true; #// modufur.enable = true; #// tailscale.cert = true; diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 99056e2..567b157 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -67,6 +67,7 @@ in { ### Server "server/borgmatic/borgbase".publicKeys = server; "server/caddy/Caddyfile".publicKeys = server; + "server/conduwuit/conduwuit.toml".publicKeys = server; "server/coturn/coturn.conf".publicKeys = server; "server/forgejo/.env".publicKeys = server; "server/forgejo/db.env".publicKeys = server; diff --git a/secrets/server/conduwuit/conduwuit.toml b/secrets/server/conduwuit/conduwuit.toml new file mode 100644 index 0000000..f80b768 Binary files /dev/null and b/secrets/server/conduwuit/conduwuit.toml differ