Update a lot of options, simplify variables, replace options with tags
This commit is contained in:
parent
dbc0ab6dd3
commit
7667ef9a1b
147 changed files with 663 additions and 928 deletions
|
@ -1,11 +1,75 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, pkgs, mailserver, ... }:
|
||||
{
|
||||
imports = [
|
||||
./go-autoconfig
|
||||
./radicale
|
||||
./roundcube
|
||||
./simplenix
|
||||
mailserver.nixosModule
|
||||
];
|
||||
|
||||
options.services.mailserver.enable = lib.mkEnableOption "Simple NixOS Mailserver";
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
mailserver = {
|
||||
fqdn = "mx.${config.vars.mainDomain}";
|
||||
domains = [
|
||||
"nixfox.ca"
|
||||
"bloxelcom.net"
|
||||
"freecorn1854.win"
|
||||
"lunamoonlight.xyz"
|
||||
];
|
||||
certificateScheme = "acme-nginx";
|
||||
localDnsResolver = false;
|
||||
redis.port = 1515;
|
||||
|
||||
# Passwords made with 'mkpasswd -sm bcrypt'
|
||||
loginAccounts = {
|
||||
"jimbo@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.bun;
|
||||
aliases = [
|
||||
"james@nixfox.ca"
|
||||
|
||||
"bun@nixfox.ca"
|
||||
"bun@bloxelcom.net"
|
||||
|
||||
"contact@nixfox.ca"
|
||||
];
|
||||
};
|
||||
|
||||
"luna@lunamoonlight.xyz" = {
|
||||
hashedPassword = config.secrets.mailHash.luna;
|
||||
aliases = [
|
||||
"luna@bloxelcom.net"
|
||||
"contact@bloxelcom.net"
|
||||
"ibu@bloxelcom.net"
|
||||
];
|
||||
};
|
||||
|
||||
"contact@freecorn1854.win" = {
|
||||
hashedPassword = config.secrets.mailHash.corn;
|
||||
aliases = [ "freecorn@bloxelcom.net" ];
|
||||
};
|
||||
|
||||
# Noreply emails
|
||||
"noreply@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.nixfoxNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
"noreply@bloxelcom.net" = {
|
||||
hashedPassword = config.secrets.mailHash.bloxelNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
redis.servers.rspamd.port = config.mailserver.redis.port;
|
||||
cloudflare-dyndns.domains = [ config.mailserver.fqdn ];
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/vmail"
|
||||
"/var/lib/dovecot"
|
||||
"/var/lib/postfix"
|
||||
"/var/lib/redis-rspamd"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
services = lib.mkIf config.services.mailserver.enable {
|
||||
services = lib.mkIf config.mailserver.enable {
|
||||
go-autoconfig = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."autoconfig.nixfox.ca" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
services.nginx.virtualHosts."autoconfig.${config.vars.mainDomain}" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
services = {
|
||||
radicale = {
|
||||
enable = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."cal.nixfox.ca" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
services.nginx.virtualHosts."cal.${config.vars.mainDomain}" = lib.mkIf config.services.radicale.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.nixfox.ca";
|
||||
hostName = "mail.${config.vars.mainDomain}";
|
||||
extraConfig = ''
|
||||
$config['smtp_server'] = "tls://mx.nixfox.ca";
|
||||
$config['smtp_server'] = "tls://mx.${config.vars.mainDomain}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
{ config, lib, pkgs, mailserver, ... }:
|
||||
{
|
||||
imports = [ mailserver.nixosModule ];
|
||||
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
mailserver = {
|
||||
enable = true;
|
||||
fqdn = "mx.nixfox.ca";
|
||||
domains = [
|
||||
"nixfox.ca"
|
||||
"bloxelcom.net"
|
||||
"freecorn1854.win"
|
||||
"lunamoonlight.xyz"
|
||||
];
|
||||
certificateScheme = "acme-nginx";
|
||||
localDnsResolver = false;
|
||||
redis.port = 1515;
|
||||
|
||||
# Passwords made with 'mkpasswd -sm bcrypt'
|
||||
loginAccounts = {
|
||||
"jimbo@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.bun;
|
||||
aliases = [
|
||||
"james@nixfox.ca"
|
||||
"jimbo@bloxelcom.net"
|
||||
|
||||
"bun@nixfox.ca"
|
||||
"bun@bloxelcom.net"
|
||||
|
||||
"contact@nixfox.ca"
|
||||
];
|
||||
};
|
||||
|
||||
"luna@lunamoonlight.xyz" = {
|
||||
hashedPassword = config.secrets.mailHash.luna;
|
||||
aliases = [
|
||||
"luna@bloxelcom.net"
|
||||
"contact@bloxelcom.net"
|
||||
"ibu@bloxelcom.net"
|
||||
];
|
||||
};
|
||||
|
||||
"contact@freecorn1854.win" = {
|
||||
hashedPassword = config.secrets.mailHash.corn;
|
||||
aliases = [ "freecorn@bloxelcom.net" ];
|
||||
};
|
||||
|
||||
# Noreply emails
|
||||
"noreply@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.nixfoxNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
"noreply@bloxelcom.net" = {
|
||||
hashedPassword = config.secrets.mailHash.bloxelNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
redis.servers.rspamd.port = config.mailserver.redis.port;
|
||||
cloudflare-dyndns.domains = [ config.mailserver.fqdn ];
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/vmail"
|
||||
"/var/lib/dovecot"
|
||||
"/var/lib/postfix"
|
||||
"/var/lib/redis-rspamd"
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue