From 16227a2f0ed489aca143c7f78ef8f40af1541ccd Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Thu, 29 Aug 2024 08:42:32 +0200 Subject: [PATCH] feat: start setup nixos simple mailserver --- flake.nix | 6 ++++++ hosts/server/configuration.nix | 34 +++++++++++++--------------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/flake.nix b/flake.nix index cb7ccb6..5f00405 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + mailserver = { + url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; outputs = { self, nixpkgs, nix-colors, automapaper, disko, hyprland, lazy, ... }@inputs: @@ -62,6 +67,7 @@ }; modules = [ disko.nixosModules.disko + inputs.mailserver.nixosModules.default ./hosts/server/configuration.nix inputs.home-manager.nixosModules.default ]; diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 6a23c4b..44ff556 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -216,12 +216,6 @@ useACMEHost = "itepastra.nl"; }; - "mail.itepastra.nl" = { - forceSSL = true; - enableACME = false; - useACMEHost = "itepastra.nl"; - }; - "pfa.itepastra.nl" = { forceSSL = true; enableACME = false; @@ -246,22 +240,20 @@ enable = true; hostName = "rc.itepastra.nl"; }; - postfix = { - enable = true; - hostname = "mail.itepastra.nl"; - origin = "itepastra.nl"; - }; - postfixadmin = { - enable = true; - hostName = "pfa.itepastra.nl"; - setupPasswordFile = /etc/postfixadminpass; - adminEmail = "noa@itepastra.nl"; - database = { - username = "postfixadmin"; - passwordFile = /etc/postfixdbpass; - dbname = "postfixadmin"; + }; + + mailserver = { + enable = true; + fqdn = "mail.itepastra.nl"; + domains = [ "itepastra.nl" ]; + + loginAccounts = { + "noa@itepastra.nl" = { + hashedPasswordFile = "/etc/passwords/noa@itepastra.nl"; }; }; + + certificateScheme = "acme-nginx"; }; security.acme = { @@ -272,7 +264,7 @@ "images.noa.voorwaarts.nl" "maintenance.noa.voorwaarts.nl" ]; - "itepastra.nl".extraDomainNames = [ "locked.itepastra.nl" "rc.itepastra.nl" "mail.itepastra.nl" "pfa.itepastra.nl" ]; + "itepastra.nl".extraDomainNames = [ "locked.itepastra.nl" "rc.itepastra.nl" "pfa.itepastra.nl" ]; }; };