diff --git a/hosts/v-th-ctr-01/home.nix b/hosts/v-th-ctr-01/home.nix index 3106533..f6e82f8 100644 --- a/hosts/v-th-ctr-01/home.nix +++ b/hosts/v-th-ctr-01/home.nix @@ -55,6 +55,7 @@ homeassistant.enable = true; karakeep.enable = true; vikunja.enable = true; + stalwart.enable = true; }; }; diff --git a/modules/home/containers/caddy.nix b/modules/home/containers/caddy.nix index 262a760..1038711 100644 --- a/modules/home/containers/caddy.nix +++ b/modules/home/containers/caddy.nix @@ -19,6 +19,9 @@ in { services.podman.containers.caddy = { image = "localhost/tboomers/caddy-custom:latest"; network = "proxy"; + networkAlias = [ + "mail.tbmrs.nl" + ]; ports = [ "1080:80" "1443:443" @@ -76,6 +79,11 @@ in { handle @dufs { reverse_proxy dufs:5000 } + + @stalwart host mail.tbmrs.nl + handle @stalwart { + reverse_proxy stalwart:8080 + } } *.local.tbmrs.nl { diff --git a/modules/home/containers/stalwart.nix b/modules/home/containers/stalwart.nix new file mode 100644 index 0000000..f8aa439 --- /dev/null +++ b/modules/home/containers/stalwart.nix @@ -0,0 +1,37 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.containers.stalwart; +in { + options = { + settings.containers.stalwart.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enable stalwart mailserver container + ''; + }; + }; + + config = mkIf cfg.enable { + services.podman.containers.stalwart = { + image = "stalwartlabs/mail-server:latest"; + network = "proxy"; + ports = [ + "1025:25" + "1587:587" + "1465:465" + "1143:143" + "1993:993" + "14190:4190" + "1110:110" + "1995:995" + ]; + volumes = [ + "%h/containers/stalwart/data:/opt/stalwart-mail" + ]; + }; + }; +} diff --git a/modules/home/default.nix b/modules/home/default.nix index 7208acd..c35ec61 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -43,5 +43,6 @@ ./containers/homeassistant.nix ./containers/karakeep.nix ./containers/vikunja.nix + ./containers/stalwart.nix ]; }