diff --git a/hosts/cube/hardware.nix b/hosts/cube/hardware.nix index 7ad1651..cc669fa 100644 --- a/hosts/cube/hardware.nix +++ b/hosts/cube/hardware.nix @@ -1,7 +1,7 @@ { lib, modulesPath, ... }: with lib; systemConfiguration { - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.loader.grub = enabled { device = "/dev/vda"; diff --git a/hosts/disk/mail/default.nix b/hosts/disk/mail/default.nix index 8513b04..6e419e2 100644 --- a/hosts/disk/mail/default.nix +++ b/hosts/disk/mail/default.nix @@ -1,10 +1,12 @@ -{ config, lib, ... }: with lib; +{ self, config, lib, ... }: with lib; let inherit (config.networking) domain; fqdn = "mail.${domain}"; in systemConfiguration { + imports = [(self + /hosts/cube/acme)]; + secrets.mailPassword.file = ./password.hash.age; services.prometheus.exporters.postfix = enabled { @@ -12,9 +14,9 @@ in systemConfiguration { }; mailserver = enabled { - inherit fqdn; + fqdn = mkDefault fqdn; - domains = [ domain ]; + domains = mkDefault [ domain ]; certificateScheme = "acme"; # We use systemd-resolved instead of Knot Resolver. @@ -31,7 +33,7 @@ in systemConfiguration { vmailGroupName = "mail"; dmarcReporting = enabled { - inherit domain; + domain = head config.mailserver.domains; organizationName = "Doofemshmirtz Evil Inc."; }; @@ -40,8 +42,8 @@ in systemConfiguration { indexAttachments = true; }; - loginAccounts."contact@${domain}" = { - aliases = [ "@${domain}" ]; + loginAccounts."contact@${head config.mailserver.domains}" = { + aliases = [ "@${head config.mailserver.domains}" ]; hashedPasswordFile = config.secrets.mailPassword.path; }; diff --git a/hosts/nine/hardware.nix b/hosts/nine/hardware.nix index fb51388..9d66a16 100644 --- a/hosts/nine/hardware.nix +++ b/hosts/nine/hardware.nix @@ -1,7 +1,7 @@ { config, lib, modulesPath, ... }: with lib; systemConfiguration { - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.loader.grub = enabled { efiSupport = true; diff --git a/hosts/nine/mail2.nix b/hosts/nine/mail2.nix new file mode 100644 index 0000000..710d0fd --- /dev/null +++ b/hosts/nine/mail2.nix @@ -0,0 +1,16 @@ +{ config, self, lib, ... }: with lib; + +let + inherit (config.networking) domain; + + fqdn = "mail2.${domain}"; +in systemConfiguration { + imports = [(self + /hosts/disk/mail)]; + + mailserver = { + inherit fqdn; + + # Not [ domain ] because this is a backup mailserver. contact@mail2.rgbcu.be. + domains = [ fqdn ]; + }; +} diff --git a/hosts/tard/hardware.nix b/hosts/tard/hardware.nix index 33b1cc1..f859d68 100644 --- a/hosts/tard/hardware.nix +++ b/hosts/tard/hardware.nix @@ -1,7 +1,7 @@ { lib, modulesPath, ... }: with lib; systemConfiguration { - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.loader.grub = enabled { device = "/dev/vda";