Add suppport for multiple Domains.
This commit is contained in:
parent
a4fde6972f
commit
bc22db3e1b
5 changed files with 79 additions and 32 deletions
|
@ -1,36 +1,51 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../options/machine.nix
|
||||
let
|
||||
cfg = config.machine;
|
||||
in {
|
||||
imports = [
|
||||
../../options/machine.nix
|
||||
../../options/mailman3/options.nix
|
||||
];
|
||||
|
||||
config.machine = {
|
||||
config.machine = rec {
|
||||
hostName = "CDServer";
|
||||
administrators = [ { name = "derped"; id = 1337; } ];
|
||||
allowUnfree = true;
|
||||
domain = "countdown-dresden.de";
|
||||
extraDomains = [ "iz-ev.de" "clubduererstrasse.de" ];
|
||||
administrators = [
|
||||
{ name = "kevin"; id = 1337; }
|
||||
{ name = "reinhold"; id= 1000; }
|
||||
];
|
||||
mailAccounts = import "${cfg.secretPath}/mailAccounts.nix";
|
||||
allowUnfree = false;
|
||||
conffiles = [
|
||||
"etcvars"
|
||||
# "security"
|
||||
"security"
|
||||
"zsh"
|
||||
];
|
||||
pkgs = [
|
||||
"base"
|
||||
"emacs"
|
||||
"server"
|
||||
];
|
||||
services = [
|
||||
"docker"
|
||||
# "fail2ban"
|
||||
# "gitea"
|
||||
# "mailserver"
|
||||
"cd-internes"
|
||||
"fail2ban"
|
||||
"gitea"
|
||||
"mailserver"
|
||||
"mariaDB"
|
||||
"nextcloud"
|
||||
"nginx"
|
||||
"openssh"
|
||||
# "cd-internes"
|
||||
# "docker"
|
||||
];
|
||||
vHosts = (flatten (map (base: [
|
||||
{ domain = base; service = "simple"; }
|
||||
{ domain = "storage.${base}"; service = "nextcloud"; }
|
||||
{ domain = "mail.${base}"; service = "mail"; }
|
||||
{ domain = "git.${base}"; service = "gitea"; }
|
||||
]) ([ domain ] ++ extraDomains)));
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowPing = false;
|
||||
|
@ -38,4 +53,22 @@ with lib;
|
|||
allowedTCPPorts = [ 80 443 ];
|
||||
};
|
||||
};
|
||||
config.services.mailman3 = {
|
||||
enable = true;
|
||||
site_owner = "derped@ophanim.de";
|
||||
database = {
|
||||
type = "mysql";
|
||||
name = "mailman3";
|
||||
user = "mailman3";
|
||||
host = "localhost";
|
||||
port = 3306;
|
||||
passwordFile = "${cfg.secretPath}/mailman3_db";
|
||||
};
|
||||
mta = {
|
||||
lmtp_host = "mail.ophanim.de";
|
||||
smtp_host = "mail.ophanim.de";
|
||||
smtp_user = "mailman3";
|
||||
smtp_passFile = "${cfg.secretPath}/mailman3_mail";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../options/machine.nix
|
||||
let
|
||||
cfg = config.machine;
|
||||
in {
|
||||
imports = [
|
||||
../../options/machine.nix
|
||||
../../options/mailman3/options.nix
|
||||
];
|
||||
|
||||
config.machine = rec {
|
||||
hostName = "Ophanim";
|
||||
domain = "ophanim.de";
|
||||
administrators = [ { name = "derped"; id = 1337; } ];
|
||||
mailAccounts = [ { name = "derped"; aliases = [ "postmaster" ]; } { name = "mailman3"; aliases = []; } ];
|
||||
domain = "ophanim.de";
|
||||
allowUnfree = true;
|
||||
conffiles = [
|
||||
"etcvars"
|
||||
|
@ -32,7 +34,6 @@ with lib;
|
|||
"nextcloud"
|
||||
"nginx"
|
||||
"openssh"
|
||||
"webblog"
|
||||
];
|
||||
vHosts = (let base = domain; in [
|
||||
{ domain = base; service = "simple"; }
|
||||
|
@ -58,13 +59,13 @@ with lib;
|
|||
user = "mailman3";
|
||||
host = "localhost";
|
||||
port = 3306;
|
||||
passwordFile = "/secret/mailman3_db";
|
||||
passwordFile = "${cfg.secretPath}/mailman3_db";
|
||||
};
|
||||
mta = {
|
||||
lmtp_host = "mail.ophanim.de";
|
||||
smtp_host = "mail.ophanim.de";
|
||||
smtp_user = "mailman3";
|
||||
smtp_passFile = "/secret/mailman3_mail";
|
||||
smtp_passFile = "${cfg.secretPath}/mailman3_mail";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue