nixos-config/modules/ihatemoney.nix

56 lines
1.3 KiB
Nix
Raw Normal View History

2022-03-29 11:25:34 +02:00
{ ... }:
let
port = "8000";
2022-09-24 19:19:00 +02:00
db = "ihatemoney";
in
{
2022-03-29 11:25:34 +02:00
services.nginx.enable = true;
services.nginx.virtualHosts."geld.mc-fucker.cool" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${port}";
};
};
2022-03-29 11:25:34 +02:00
security.acme = {
acceptTerms = true;
defaults.email = "dev@mc-fucker.cool";
};
2022-09-24 19:19:00 +02:00
virtualisation.oci-containers.containers.ihatemoney = {
image = "9508e0286152";
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";
};
2022-03-29 11:25:34 +02:00
networking.firewall.allowedTCPPorts = [ 80 443 ];
2022-07-19 12:26:25 +02:00
services.postgresqlBackup.databases = [ "ihatemoney" ];
}
# vim: set et ts=2 sw=2 ai: