diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-10-02 00:27:50 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-10-02 00:27:50 +0200 |
| commit | 82d1dc4549f3ba079505b6ebaa266e6d04d1cce4 (patch) | |
| tree | 2377a080b1946b921f85fbc42c2a9385446760d7 /tests/by-name/st/stalwart-email-http/nodes | |
| parent | pkgs/fetchmail-common-name: Update patch, so that it applies again (diff) | |
| download | nixos-server-82d1dc4549f3ba079505b6ebaa266e6d04d1cce4.zip | |
tests/email/*: Rename to stalwart email tests
These tests explicitly test our stalwart email module.
Diffstat (limited to 'tests/by-name/st/stalwart-email-http/nodes')
| -rw-r--r-- | tests/by-name/st/stalwart-email-http/nodes/mail_server.nix | 57 | ||||
| -rw-r--r-- | tests/by-name/st/stalwart-email-http/nodes/user.nix | 26 |
2 files changed, 83 insertions, 0 deletions
diff --git a/tests/by-name/st/stalwart-email-http/nodes/mail_server.nix b/tests/by-name/st/stalwart-email-http/nodes/mail_server.nix new file mode 100644 index 0000000..e94c4e9 --- /dev/null +++ b/tests/by-name/st/stalwart-email-http/nodes/mail_server.nix @@ -0,0 +1,57 @@ +{ + extraModules, + pkgs, + vhackPackages, +}: { + mkMailServer = serverName: principal: { + config, + lib, + nodes, + ... + }: { + imports = + extraModules + ++ [ + ../../../../../modules + ../../../../common/acme/client.nix + ]; + + environment.systemPackages = [ + pkgs.bind + pkgs.openssl + ]; + + networking.nameservers = lib.mkForce [ + nodes.name_server.networking.primaryIPAddress + nodes.name_server.networking.primaryIPv6Address + ]; + + age.identityPaths = ["${../../../../common/email/hostKey}"]; + + vhack = { + stalwart-mail = { + enable = true; + fqdn = "${serverName}.server.com"; + admin = "admin@${serverName}.server.com"; + security = { + dkimKeys = let + loadKey = name: { + dkimPublicKey = builtins.readFile (../../../../common/email/dkim + "/${name}/public"); + dkimPrivateKeyPath = ../../../../common/email/dkim + "/${name}/private.age"; + keyAlgorithm = "ed25519-sha256"; + }; + in { + "mail.server.com" = loadKey "mail1.server.com"; + "bob.com" = loadKey "bob.com"; + }; + verificationMode = "strict"; + }; + openFirewall = true; + principals = + if principal == null + then null + else [principal]; + }; + }; + }; +} diff --git a/tests/by-name/st/stalwart-email-http/nodes/user.nix b/tests/by-name/st/stalwart-email-http/nodes/user.nix new file mode 100644 index 0000000..73b9ff7 --- /dev/null +++ b/tests/by-name/st/stalwart-email-http/nodes/user.nix @@ -0,0 +1,26 @@ +{ + pkgs, + vhackPackages, +}: { + mkUser = user: serverName: { + nodes, + lib, + ... + }: { + imports = [ + ../../../../common/acme/client.nix + ]; + + environment.systemPackages = [ + pkgs.bind + pkgs.openssl + ]; + + networking.nameservers = lib.mkForce [ + nodes.name_server.networking.primaryIPAddress + nodes.name_server.networking.primaryIPv6Address + ]; + + users.users."${user}" = {isNormalUser = true;}; + }; +} |
