2022-09-21 18:00:51 +02:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
2023-05-04 13:08:10 +02:00
|
|
|
|
let vs = config.vault-secrets.secrets;
|
|
|
|
|
in {
|
2022-09-21 18:00:51 +02:00
|
|
|
|
imports = [ ];
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "22.11"; # Did you read the comment?
|
|
|
|
|
|
2022-09-22 09:27:21 +02:00
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
|
|
2022-09-22 11:03:10 +02:00
|
|
|
|
# needed as the mailserver configures its down DNS resolver
|
2022-09-22 09:27:21 +02:00
|
|
|
|
networking.extraHosts = ''
|
|
|
|
|
10.42.42.6 vault.olympus
|
|
|
|
|
'';
|
|
|
|
|
|
2023-05-04 13:08:10 +02:00
|
|
|
|
vault-secrets.secrets.mailserver = { services = [ "dovecot2" "postfix" ]; };
|
2022-09-21 18:00:51 +02:00
|
|
|
|
|
|
|
|
|
mailserver = {
|
2022-09-22 09:27:21 +02:00
|
|
|
|
enable = true;
|
2022-09-21 18:00:51 +02:00
|
|
|
|
fqdn = "mail.0x76.dev";
|
2023-06-08 16:46:19 +02:00
|
|
|
|
domains = [ "0x76.dev" "meowy.tech" "xirion.net" ];
|
2023-06-01 09:14:53 +02:00
|
|
|
|
certificateScheme = "acme-nginx";
|
2023-06-08 16:46:19 +02:00
|
|
|
|
enableManageSieve = true;
|
2022-09-21 18:00:51 +02:00
|
|
|
|
|
2023-06-08 16:53:56 +02:00
|
|
|
|
monitoring = {
|
|
|
|
|
alertAddress = "v@0x76.dev";
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-29 15:11:57 +01:00
|
|
|
|
forwards = {
|
|
|
|
|
"thijmen@xirion.net" = "Thijmen@nouwens-lindemans.nl";
|
|
|
|
|
};
|
|
|
|
|
|
2022-09-22 09:27:21 +02:00
|
|
|
|
loginAccounts = {
|
2022-10-10 16:28:36 +02:00
|
|
|
|
# People
|
2022-09-22 09:27:21 +02:00
|
|
|
|
"v@0x76.dev" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/v@0x76.dev";
|
2023-06-08 16:46:19 +02:00
|
|
|
|
catchAll = [ "xirion.net" "0x76.dev" ];
|
|
|
|
|
aliases = [
|
|
|
|
|
"postmaster@0x76.dev"
|
|
|
|
|
"abuse@0x76.dev"
|
|
|
|
|
|
|
|
|
|
"v@meowy.tech"
|
|
|
|
|
"abuse@meowy.tech"
|
|
|
|
|
"postmaster@meowy.tech"
|
|
|
|
|
|
|
|
|
|
"@xirion.net"
|
|
|
|
|
"@0x76.dev"
|
|
|
|
|
];
|
2022-09-22 09:27:21 +02:00
|
|
|
|
};
|
2022-10-10 16:28:36 +02:00
|
|
|
|
"laura@meowy.tech" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/laura@meowy.tech";
|
|
|
|
|
aliases = [ "lau@meowy.tech" ];
|
|
|
|
|
};
|
2023-06-08 16:46:19 +02:00
|
|
|
|
|
2022-10-10 16:28:36 +02:00
|
|
|
|
# Services
|
2022-09-25 16:42:18 +02:00
|
|
|
|
"gitea@0x76.dev" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/gitea@0x76.dev";
|
2022-09-25 23:49:26 +02:00
|
|
|
|
sendOnly = true;
|
|
|
|
|
};
|
|
|
|
|
"matrix@meowy.tech" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/matrix@meowy.tech";
|
|
|
|
|
sendOnly = true;
|
|
|
|
|
};
|
|
|
|
|
"outline@0x76.dev" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/outline@0x76.dev";
|
|
|
|
|
sendOnly = true;
|
2022-09-25 16:42:18 +02:00
|
|
|
|
};
|
2022-10-10 15:24:54 +02:00
|
|
|
|
"vaultwarden@0x76.dev" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/vaultwarden@0x76.dev";
|
|
|
|
|
sendOnly = true;
|
|
|
|
|
};
|
2023-06-09 19:19:15 +02:00
|
|
|
|
"snapraid@0x76.dev" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/snapraid@0x76.dev";
|
|
|
|
|
sendOnly = true;
|
|
|
|
|
};
|
2023-06-13 09:53:54 +02:00
|
|
|
|
"mastodon@xirion.net" = {
|
|
|
|
|
hashedPasswordFile = "${vs.mailserver}/mastodon@xirion.net";
|
|
|
|
|
sendOnly = true;
|
|
|
|
|
};
|
2022-09-22 09:27:21 +02:00
|
|
|
|
};
|
|
|
|
|
|
2022-09-22 10:01:42 +02:00
|
|
|
|
indexDir = "/var/lib/dovecot/indices";
|
|
|
|
|
fullTextSearch = {
|
|
|
|
|
enable = true;
|
|
|
|
|
# index new email as they arrive
|
|
|
|
|
autoIndex = true;
|
|
|
|
|
# this only applies to plain text attachments, binary attachments are never indexed
|
|
|
|
|
indexAttachments = true;
|
|
|
|
|
enforced = "body";
|
|
|
|
|
memoryLimit = 2000;
|
|
|
|
|
autoIndexExclude = [ "\\Junk" ];
|
|
|
|
|
};
|
2022-09-21 18:00:51 +02:00
|
|
|
|
};
|
2023-09-25 11:56:02 +02:00
|
|
|
|
services = {
|
2022-09-22 09:27:21 +02:00
|
|
|
|
|
2023-09-25 11:56:02 +02:00
|
|
|
|
postfix.relayHost = "smtp.ziggozakelijk.nl";
|
|
|
|
|
postfix.relayPort = 587;
|
2022-09-25 12:44:52 +02:00
|
|
|
|
|
2023-09-25 11:56:02 +02:00
|
|
|
|
roundcube = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = pkgs.roundcube.withPlugins
|
|
|
|
|
(plugins: [ plugins.persistent_login pkgs.v.roundcube-swipe ]);
|
|
|
|
|
plugins = [
|
|
|
|
|
"archive"
|
|
|
|
|
"managesieve"
|
|
|
|
|
"swipe"
|
|
|
|
|
# "enigma"
|
|
|
|
|
# "markasjunk"
|
|
|
|
|
"persistent_login"
|
2023-06-16 09:05:38 +02:00
|
|
|
|
];
|
2023-09-25 11:56:02 +02:00
|
|
|
|
# this is the url of the vhost, not necessarily the same as the fqdn of
|
|
|
|
|
# the mailserver
|
|
|
|
|
hostName = "webmail.0x76.dev";
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
# starttls needed for authentication, so the fqdn required to match
|
|
|
|
|
# the certificate
|
|
|
|
|
$config['smtp_host'] = "tls://${config.mailserver.fqdn}";
|
|
|
|
|
$config['smtp_user'] = "%u";
|
|
|
|
|
$config['smtp_pass'] = "%p";
|
|
|
|
|
|
|
|
|
|
$config['swipe_actions'] = [
|
|
|
|
|
'messagelist' => [
|
|
|
|
|
'left' => 'archive',
|
|
|
|
|
'right' => 'archive',
|
|
|
|
|
'down' => 'none'
|
|
|
|
|
],
|
|
|
|
|
'contactlist' => [
|
|
|
|
|
'left' => 'none',
|
|
|
|
|
'right' => 'none',
|
|
|
|
|
'down' => 'none'
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
'';
|
|
|
|
|
};
|
2022-09-22 09:27:21 +02:00
|
|
|
|
|
2023-09-25 11:56:02 +02:00
|
|
|
|
nginx = { enable = true; };
|
|
|
|
|
};
|
2022-09-22 09:27:21 +02:00
|
|
|
|
|
|
|
|
|
security.acme.acceptTerms = true;
|
2022-09-25 12:44:52 +02:00
|
|
|
|
security.acme.defaults.email = "v@0x76.dev";
|
2022-09-21 18:00:51 +02:00
|
|
|
|
}
|