1 { config, lib, pkgs, ... }:
3 cfg = config.myServices.websites.tools.stats;
4 myCfg = config.myEnv.tools.umami;
7 options.myServices.websites.tools.stats.enable = lib.mkEnableOption "Enable stats site";
8 config = lib.mkIf cfg.enable {
13 PORT=${toString myCfg.listenPort}
15 DATABASE_URL=postgresql://${myCfg.postgresql.user}:${myCfg.postgresql.password}@localhost:${myCfg.postgresql.port}/${myCfg.postgresql.database}?sslmode=disable&host=${myCfg.postgresql.socket}
16 HASH_SALT=${myCfg.hashSalt}
21 services.websites.env.tools.vhostConfs.stats = {
24 hosts = [ "stats.immae.eu" ];
28 ProxyPass / http://localhost:${toString myCfg.listenPort}/
29 ProxyPassReverse / http://localhost:${toString myCfg.listenPort}/
34 systemd.services.umami = {
35 description = "Umami service";
36 wantedBy = [ "multi-user.target" ];
37 after = [ "network.target" ];
38 wants = [ "postgresql.service" ];
39 path = [ pkgs.nodejs pkgs.bashInteractive ];
45 SupplementaryGroups = [ "keys" ];
46 ExecStart = "${pkgs.umami}/bin/umami";
47 EnvironmentFile = config.secrets.fullPaths."umami/env";