diff --git a/flake.nix b/flake.nix index 7951467..8638820 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-mailserver = { + url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + dzgui-nix = { url = "github:lelgenio/dzgui-nix"; }; diff --git a/hosts/ghost/default.nix b/hosts/ghost/default.nix index 040a093..04196b3 100644 --- a/hosts/ghost/default.nix +++ b/hosts/ghost/default.nix @@ -11,6 +11,7 @@ ./users.nix ./writefreely.nix ./renawiki.nix + ./email.nix ]; # Use more aggressive compression then the default. diff --git a/hosts/ghost/email.nix b/hosts/ghost/email.nix new file mode 100644 index 0000000..39afdb6 --- /dev/null +++ b/hosts/ghost/email.nix @@ -0,0 +1,34 @@ +{ pkgs, inputs, ... }: { + networking.hostName = "lelgenio.xyz"; + + imports = [ + inputs.nixos-mailserver.nixosModules.mailserver + ]; + + mailserver = { + enable = true; + fqdn = "mail.lelgenio.xyz"; + domains = [ "lelgenio.xyz" ]; + certificateScheme = "acme-nginx"; + loginAccounts = { + "lelgenio@lelgenio.xyz" = { + hashedPassword = "$2y$05$z5s7QCXcs5uTFsfyYpwNJeWzb3RmzgWxNgcPCr0zjSytkLFF/qZmS"; + aliases = [ "postmaster@lelgenio.xyz" ]; + }; + }; + }; + + # Webmail + services.roundcube = rec { + enable = true; + package = pkgs.roundcube.withPlugins (p: [ p.carddav ]); + hostName = "mail.lelgenio.xyz"; + extraConfig = '' + $config['smtp_host'] = "tls://${hostName}:587"; + $config['smtp_user'] = "%u"; + $config['smtp_pass'] = "%p"; + $config['plugins'] = [ "carddav" ]; + ''; + }; + +}