refactor: den-native config, tunnel quirk, per-module inputs
This commit is contained in:
1 parent
0431bce152
commit
bfbac8b961
100 files changed
+668
-1417
No files matched your search
@@ -1,15 +1,21 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
den.aspects.mailserver = {
|
||||
nixos = {
|
||||
flake-file.inputs.nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
den.aspects.services.mailserver = let port = 8088; in {
|
||||
tunnel = [
|
||||
{ subdomain = "mail"; inherit port; }
|
||||
{ subdomain = "email"; inherit port; }
|
||||
];
|
||||
|
||||
nixos = { host, config, ... }: let user = host.owner; home = config.users.users.${user}.home; inherit (host) domain; in {
|
||||
imports = [ inputs.nixos-mailserver.nixosModules.default ];
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "security@bug.tools";
|
||||
defaults.email = "security@${domain}";
|
||||
|
||||
certs."mx.bug.tools" = {
|
||||
listenHTTP = "1360";
|
||||
certs."mx.${domain}" = {
|
||||
listenHTTP = ":1360";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,10 +24,10 @@
|
||||
|
||||
stateVersion = 4;
|
||||
|
||||
fqdn = "mx.bug.tools";
|
||||
domains = [ "bug.tools" ];
|
||||
fqdn = "mx.${domain}";
|
||||
domains = [ "${domain}" ];
|
||||
|
||||
x509.useACMEHost = "mx.bug.tools";
|
||||
x509.useACMEHost = "mx.${domain}";
|
||||
|
||||
fullTextSearch = {
|
||||
enable = true;
|
||||
@@ -30,51 +36,46 @@
|
||||
};
|
||||
|
||||
accounts = {
|
||||
"bug@bug.tools" = {
|
||||
hashedPasswordFile = "/home/bug/mailserver/bug.passwd";
|
||||
"${user}@${domain}" = {
|
||||
hashedPasswordFile = "${home}/mailserver/bug.passwd";
|
||||
aliases = [
|
||||
"admin@bug.tools"
|
||||
"security@bug.tools"
|
||||
"google@bug.tools"
|
||||
"apple@bug.tools"
|
||||
"roblox@bug.tools"
|
||||
"twitch@bug.tools"
|
||||
"discord@bug.tools"
|
||||
"github@bug.tools"
|
||||
"matrix@bug.tools"
|
||||
"git@bug.tools"
|
||||
"contact@bug.tools"
|
||||
"claude@bug.tools"
|
||||
"rumble@bug.tools"
|
||||
"bambu@bug.tools"
|
||||
"soulframe@bug.tools"
|
||||
"vortex@bug.tools"
|
||||
"codex@bug.tools"
|
||||
"tailscale@bug.tools"
|
||||
"firefox@bug.tools"
|
||||
"keldurn@bug.tools"
|
||||
"brax@bug.tools"
|
||||
"admin@${domain}"
|
||||
"security@${domain}"
|
||||
"google@${domain}"
|
||||
"apple@${domain}"
|
||||
"roblox@${domain}"
|
||||
"twitch@${domain}"
|
||||
"discord@${domain}"
|
||||
"github@${domain}"
|
||||
"matrix@${domain}"
|
||||
"git@${domain}"
|
||||
"contact@${domain}"
|
||||
"claude@${domain}"
|
||||
"rumble@${domain}"
|
||||
"bambu@${domain}"
|
||||
"soulframe@${domain}"
|
||||
"vortex@${domain}"
|
||||
"codex@${domain}"
|
||||
"tailscale@${domain}"
|
||||
"firefox@${domain}"
|
||||
"keldurn@${domain}"
|
||||
"brax@${domain}"
|
||||
];
|
||||
};
|
||||
|
||||
"pare@bug.tools" = {
|
||||
hashedPasswordFile = "/home/bug/mailserver/pare.passwd";
|
||||
"pare@${domain}" = {
|
||||
hashedPasswordFile = "${home}/mailserver/pare.passwd";
|
||||
};
|
||||
|
||||
"poop@bug.tools" = {
|
||||
hashedPasswordFile = "/home/bug/mailserver/pare.passwd";
|
||||
"poop@${domain}" = {
|
||||
hashedPasswordFile = "${home}/mailserver/pare.passwd";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
den.tunnels = [
|
||||
"mail"
|
||||
"email"
|
||||
];
|
||||
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.bug.tools";
|
||||
hostName = "mail.${domain}";
|
||||
extraConfig = ''
|
||||
$config['imap_host'] = 'ssl://localhost:993';
|
||||
$config['imap_conn_options'] = [
|
||||
@@ -86,20 +87,20 @@
|
||||
];
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
$config['username_domain'] = 'bug.tools';
|
||||
$config['username_domain'] = '${domain}';
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.enable = true;
|
||||
|
||||
services.nginx.virtualHosts."mail.bug.tools" = {
|
||||
services.nginx.virtualHosts."mail.${domain}" = {
|
||||
forceSSL = false;
|
||||
enableACME = false;
|
||||
|
||||
listen = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 8088;
|
||||
port = port;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user