nixos-config/modules/ihatemoney.nix
2022-10-07 10:12:43 +02:00

55 lines
1.3 KiB
Nix

{ ... }:
let
port = "8000";
db = "ihatemoney";
in
{
services.nginx.enable = true;
services.nginx.virtualHosts."geld.mc-fucker.cool" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${port}";
};
};
security.acme = {
acceptTerms = true;
defaults.email = "dev@mc-fucker.cool";
};
virtualisation.oci-containers.containers.ihatemoney = {
image = "e0f5c301fa0c";
environment = {
ACTIVATE_ADMIN_DASHBOARD = "True";
ACTIVATE_DEMO_PROJECT = "False";
ALLOW_PUBLIC_PROJECT_CREATION = "False";
MAIL_DEFAULT_SENDER = "Budget manager <ihatemoney@mc-fucker.cool>";
MAIL_SERVER = "mc1.mc-fucker.vpn.mc-fucker.cool";
MAIL_USE_TLS = "True";
DEBUG = "False";
};
ports = [ "${port}:8000" ];
environmentFiles = [ /etc/nixos/keys/ihatemoney-env ];
};
services.postgresql = {
ensureDatabases = [ db ];
ensureUsers = [
{
name = db;
ensurePermissions = {
"DATABASE ${db}" = "ALL PRIVILEGES";
};
}
];
authentication = "host ${db} ${db} 10.88.0.0/16 md5";
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.postgresqlBackup.databases = [ "ihatemoney" ];
}
# vim: set et ts=2 sw=2 ai: