ghost: add mail server

This commit is contained in:
Leonardo Eugênio 2024-03-27 02:28:28 -03:00
parent eb25c3c32f
commit 08d66a4053
3 changed files with 40 additions and 0 deletions

View file

@ -32,6 +32,11 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
dzgui-nix = { dzgui-nix = {
url = "github:lelgenio/dzgui-nix"; url = "github:lelgenio/dzgui-nix";
}; };

View file

@ -11,6 +11,7 @@
./users.nix ./users.nix
./writefreely.nix ./writefreely.nix
./renawiki.nix ./renawiki.nix
./email.nix
]; ];
# Use more aggressive compression then the default. # Use more aggressive compression then the default.

34
hosts/ghost/email.nix Normal file
View file

@ -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" ];
'';
};
}