server-configuration/services/ferron.nix
2025-06-09 09:24:32 +00:00

51 lines
1.1 KiB
Nix
Executable file

{
lib,
pkgs,
...
}: let
ferron-conf-nix = {
global = {
secure = true;
enableAutomaticTLS = true;
automaticTLSContactCacheDirectory = "/etc/ferron/contactCacheDir";
useAutomaticTLSHTTPChallenge = true;
disableProxyCertificateVerification = true;
loadModules = ["rproxy"];
};
hosts = [
{
domain = "mtgmonkey.net";
proxyTo = "http://localhost:9080/";
}
{
domain = "blog.mtgmonkey.net";
proxyTo = "http://localhost:9181/";
}
{
domain = "git.mtgmonkey.net";
proxyTo = "http://localhost:8000/";
}
{
domain = "chat.mtgmonkey.net";
proxyTo = "http://localhost:9780/";
}
{
domain = "spacebar-api.mtgmonkey.net";
proxyTo = "http://localhost:3001/";
}
];
};
in {
systemd.services.ferron = {
serviceConfig = {
Type = "simple";
ExecStart = "${lib.getExe pkgs.ferron} --config=/etc/ferron.yaml";
RemainAfterExit = true;
};
};
environment.etc."ferron.yaml" = {
source = (pkgs.formats.yaml {}).generate "" ferron-conf-nix;
mode = "644";
};
}