config-perso/machines/kat-mail-test/default.nix
2024-10-03 23:18:10 +02:00

93 lines
1.8 KiB
Nix

{
config,
lib,
pkgs,
sources,
...
}:
let
host = "catvayor.sh";
in
{
imports = [
"${sources.nixos-mailserver}"
./hardware-configuration.nix
./disks.nix
./modo.nix
];
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking = {
useNetworkd = lib.mkForce false;
interfaces."enp1s0" = {
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.122.3";
prefixLength = 24;
}
];
ipv6.addresses = [
{
address = "fe80::3";
prefixLength = 64;
}
];
};
defaultGateway = "192.168.122.1";
defaultGateway6 = {
address = "fe80::1";
interface = "enp1s0";
};
nameservers = [
"192.168.122.1"
"fe80::1%enp1s0"
];
};
services = {
openssh.enable = true;
netbird.enable = true;
};
networking.firewall.enable = false;
security.acme = {
acceptTerms = true;
defaults.email = "root@katvayor.net";
};
services.nginx = {
enable = true;
virtualHosts."catvayor.sh".enableACME = true;
virtualHosts."betamail.katvayor.net" = {
enableACME = true;
addSSL = true;
locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://localhost:8000/";
};
};
};
mailserver = {
enable = true;
fqdn = "betamail.katvayor.net";
domains = [ host ];
loginAccounts = {
"root@${host}" = {
catchAll = [ host ];
aliases = builtins.genList (id: "user${toString id}@${host}") 10 ++ [ "moderators@${host}" "daemon@${host}" ];
hashedPassword = "$2b$05$FoCVDECXYG0KXPigPuIZtuNFiviwSg8RuXx0FbnzC7ZRp.Mz8VWOe";
};
};
certificateScheme = "acme";
};
system.stateVersion = "23.11";
}