This commit is contained in:
admin 2024-07-02 09:26:34 +02:00
parent 719eda9db9
commit fee2fa1967
2 changed files with 41 additions and 20 deletions

View file

@ -108,13 +108,13 @@
home = "/home/sondell"; home = "/home/sondell";
isNormalUser = true; isNormalUser = true;
description = "sondell"; description = "sondell";
extraGroups = ["networkmanager" "wheel" "backup"]; extraGroups = ["networkmanager" "wheel" "backup" "opendkim" ];
packages = with pkgs; [ packages = with pkgs; [
firefox firefox
# thunderbird # thunderbird
]; ];
}; };
users.groups."backup".gid = 1337; # users.groups."backup".gid = 1337;
users.users.root = { users.users.root = {

View file

@ -1,17 +1,39 @@
{ mailserver , ... }: {mailserver, ...}: let
let
domain = "sondell.org"; domain = "sondell.org";
fqdn = "mail.${domain}"; fqdn = "mail.${domain}";
in mailDirectory = "/var/vmail";
{ dkimKeyDirectory = "/var/dkim";
in {
imports = [ imports = [
mailserver mailserver
]; ];
services.restic.backups = {
"mail" = {
passwordFile = "/etc/nixos/.secrets/restic_pw";
repository = "sftp:Glenn@nas:/home/back/mail/restic";
initialize = true;
paths = [
mailDirectory
dkimKeyDirectory
];
user = "sondell";
timerConfig.OnCalendar = "02:05";
pruneOpts = [
"--keep-daily 10"
"--keep-weekly 5"
"--keep-monthly 12"
"--keep-yearly 75"
];
};
};
mailserver = { mailserver = {
enable = true; enable = true;
inherit mailDirectory dkimKeyDirectory;
fqdn = fqdn; fqdn = fqdn;
domains = [ domain ]; domains = [domain];
vmailGroupName = "backup";
# A list of all login accounts. To create the password hashes, use # A list of all login accounts. To create the password hashes, use
# cat .secrets/nextadminpw | nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > .secrets/mailpw.hash # cat .secrets/nextadminpw | nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > .secrets/mailpw.hash
@ -35,17 +57,16 @@ in
}; };
services.roundcube = { services.roundcube = {
enable = true; enable = true;
# this is the url of the vhost, not necessarily the same as the fqdn of # this is the url of the vhost, not necessarily the same as the fqdn of
# the mailserver # the mailserver
hostName = "webmail.${domain}"; hostName = "webmail.${domain}";
extraConfig = '' extraConfig = ''
# starttls needed for authentication, so the fqdn required to match # starttls needed for authentication, so the fqdn required to match
# the certificate # the certificate
$config['smtp_server'] = "tls://${fqdn}"; $config['smtp_server'] = "tls://${fqdn}";
$config['smtp_user'] = "%u"; $config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p"; $config['smtp_pass'] = "%p";
''; '';
}; };
} }