NixOS-Config/nixos/package-configs/mail-server/configuration.nix

104 lines
2.7 KiB
Nix
Raw Normal View History

2023-11-24 15:35:17 +01:00
{
inputs,
outputs,
lib,
2023-11-24 15:35:17 +01:00
config,
pkgs,
...
}: {
imports = [
(builtins.fetchTarball {
# Pick a release version you are interested in and set its hash, e.g.
2023-11-25 00:58:59 +01:00
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/24128c3052090311688b09a400aa408ba61c6ee5/nixos-mailserver-A-COMMIT-ID.tar.gz";
2023-11-24 15:35:17 +01:00
# To get the sha256 of the nixos-mailserver tarball, we can use the nix-prefetch-url command:
2023-11-25 00:58:59 +01:00
# release="nixos-23.05"; nix-prefetch-url "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/24128c3052090311688b09a400aa408ba61c6ee5/nixos-mailserver-A-COMMIT-ID.tar.gz" --unpack
sha256 = "1ngil2shzkf61qxiqw11awyl81cr7ks2kv3r3k243zz7v2xakm5c";
2023-11-24 15:35:17 +01:00
})
];
2023-11-24 15:46:14 +01:00
2023-11-27 14:12:18 +01:00
sops.secrets."mailpass".mode = "0440";
sops.secrets."mailpass".owner = config.users.users.virtualMail.name;
2023-12-19 11:17:48 +01:00
# users.users = {
# virtualMail = {
# isSystemUser = true;
# isNormalUser = false;
# group = "virtualMail";
# };
# };
2023-11-27 14:12:18 +01:00
2023-11-24 15:35:17 +01:00
mailserver = {
enable = true;
2023-11-25 01:15:34 +01:00
enableImap = true;
2023-11-25 01:20:13 +01:00
enableSubmission = true;
2023-11-24 15:35:17 +01:00
fqdn = "mail.gladtherescake.eu";
domains = [
"nextcloud.gladtherescake.eu"
"akkoma.gladtherescake.eu"
"social.gladtherescake.eu"
2023-12-15 22:06:04 +01:00
"lillianviolet.dev"
];
2023-11-24 15:35:17 +01:00
loginAccounts = {
"no-reply@nextcloud.gladtherescake.eu" = {
hashedPasswordFile = config.sops.secrets."mailpass".path;
};
2023-11-25 14:14:34 +01:00
"no-reply@akkoma.gladtherescake.eu" = {
hashedPasswordFile = config.sops.secrets."mailpass".path;
};
"no-reply@social.gladtherescake.eu" = {
hashedPasswordFile = config.sops.secrets."mailpass".path;
};
2023-12-15 21:20:10 +01:00
"info@lillianviolet.dev" = {
hashedPasswordFile = config.sops.secrets."mailpass".path;
aliases = [
"@lillianviolet.dev"
];
catchAll = [
"lillianviolet.dev"
];
};
2023-11-24 15:35:17 +01:00
};
2023-12-15 22:06:04 +01:00
2023-12-17 17:20:19 +01:00
mailboxes = {
2023-12-17 17:22:23 +01:00
All = {
2023-12-17 17:20:19 +01:00
auto = "subscribe";
2023-12-17 17:22:23 +01:00
specialUse = "All";
};
Archive = {
auto = "subscribe";
specialUse = "Archive";
2023-12-17 17:20:19 +01:00
};
Drafts = {
auto = "subscribe";
specialUse = "Drafts";
};
Junk = {
auto = "subscribe";
specialUse = "Junk";
};
Sent = {
auto = "subscribe";
specialUse = "Sent";
};
Trash = {
auto = "no";
specialUse = "Trash";
};
};
2023-12-15 22:06:04 +01:00
rejectRecipients = [
"no-reply@nextcloud.gladtherescake.eu"
"no-reply@akkoma.gladtherescake.eu"
"no-reply@social.gladtherescake.eu"
];
certificateScheme = "acme-nginx";
2023-12-15 22:11:07 +01:00
certificateDomains = [
"imap.lillianviolet.dev"
"mail.lillianviolet.dev"
"pop3.lillianviolet.dev"
"lillianviolet.dev"
];
2023-11-24 15:35:17 +01:00
};
}