nixos-config/modules/ihatemoney.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

2022-03-29 11:25:34 +02:00
{ ... }:
let
2023-01-31 16:48:31 +01:00
cfg = import ./vars.nix;
port = cfg.ihatemoney.port;
db = cfg.ihatemoney.db;
domain = cfg.ihatemoney.domain;
in
{
2023-01-31 16:48:31 +01:00
imports = [ ./nginx.nix ];
2022-10-30 15:51:48 +01:00
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${port}";
};
2022-10-30 15:51:48 +01:00
extraConfig = ''
access_log /var/log/nginx/${domain}_access.log;
error_log /var/log/nginx/${domain}_error.log;
'';
};
2022-03-29 11:25:34 +02:00
2022-09-24 19:19:00 +02:00
virtualisation.oci-containers.containers.ihatemoney = {
2023-01-13 15:15:19 +01:00
image = "cfa3c41cf3ac";
2022-09-24 19:19:00 +02:00
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";
};
2023-01-31 16:48:31 +01:00
ports = [ "${port}:${port}" ];
2022-09-24 19:19:00 +02:00
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-07-19 12:26:25 +02:00
services.postgresqlBackup.databases = [ "ihatemoney" ];
}
# vim: set et ts=2 sw=2 ai: