{ config, pkgs, ...}: let caddyDir = "/var/lib/caddy"; in { services.grafana = { enable = true; domain = "sup.atlanticaweb"; port = 2342; addr = "127.0.0.1"; }; services.caddy = { enable = true; email = "lucazeau.alexandre@gmail.com"; config = '' { storage file_system { root ${caddyDir} } } https://grafana.atlanticaweb.fr { reverse_proxy http://127.0.0.1:${toString config.services.grafana.port} } ''; }; users.users.caddy = { group = "caddy"; uid = config.ids.uids.caddy; home = caddyDir; createHome = true; extraGroups = [ "users" ]; }; users.groups.caddy.gid = config.ids.uids.caddy; }