diff --git a/flake.nix b/flake.nix index d9a1603..61e83aa 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,7 @@ }; nix-comfyui.url = "github:dyscorv/nix-comfyui"; deploy-rs.url = "github:serokell/deploy-rs"; + simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.11"; }; outputs = { nixpkgs, @@ -21,6 +22,7 @@ nix-bitcoin, nix-comfyui, deploy-rs, + simple-nixos-mailserver, self, ... }: let @@ -49,6 +51,7 @@ specialArgs = { inherit unstable; }; modules = [ ./system/shen/configuration.nix + simple-nixos-mailserver.nixosModule home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/modules/mail.nix b/modules/mail.nix new file mode 100644 index 0000000..b16498a --- /dev/null +++ b/modules/mail.nix @@ -0,0 +1,30 @@ + +{ config, lib, pkgs, unstable, ... }: + +let + dn = "mail.tfcconnection.org" ; +in +with lib; +{ + mailserver = { + enable = true; + fqdn = dn; + domains = [ dn ]; + + # A list of all login accounts. To create the password hashes, use + # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' + loginAccounts = { + "chris@${dn}" = { + hashedPassword = "$2b$05$xHEdyWDJPeJMJ1kp2imf/Ozcxe9BuAMvKfejxFM24AQga/cHw80M."; + aliases = ["postmaster@example.com"]; + }; + "no-reply@${dn}" = { + hashedPasswordFile = "$2b$05$MjuzjclERF7TF1I/o7cFMONHTb0VBZCk9CNRFzmWxwBUj4558S5tK"; + }; + }; + + # Use Let's Encrypt certificates. Note that this needs to set up a stripped + # down nginx and opens port 80. + certificateScheme = "acme-nginx"; + }; +} diff --git a/system/shen/configuration.nix b/system/shen/configuration.nix index 2ad06af..405d292 100644 --- a/system/shen/configuration.nix +++ b/system/shen/configuration.nix @@ -31,6 +31,7 @@ in ../../modules/nextcloud.nix ../../modules/ollama.nix ../../modules/searx.nix + ../../modules/mail.nix # ../../pkgs/server.nix # ../../pkgs/nextcloud.nix ];