feat: mailserver

This commit is contained in:
DACHXY 2025-08-14 12:27:49 +08:00
parent 0ebf0d7a29
commit b8a31b6264
28 changed files with 2446 additions and 1350 deletions

36
system/modules/actual.nix Normal file
View file

@ -0,0 +1,36 @@
{
fqdn ? null,
}:
{ config, ... }:
let
inherit (builtins) toString;
finalFqdn = if fqdn != null then fqdn else config.networking.fqdn;
in
{
services.actual = {
enable = true;
settings = {
port = 31000;
hostname = "127.0.0.1";
serverFiles = "/var/lib/actual/server-files";
userFiles = "/var/lib/actual/user-files";
loginMethod = "openid";
};
};
services.actual-budget-api = {
enable = true;
listenPort = 31001;
listenHost = "127.0.0.1";
serverURL = "https://${finalFqdn}";
};
services.nginx.virtualHosts."${finalFqdn}" = {
enableACME = true;
forceSSL = true;
locations."/api/".proxyPass =
"http://localhost:${toString config.services.actual-budget-api.listenPort}/";
locations."/".proxyPass = "http://localhost:${toString config.services.actual.settings.port}";
};
}