{ ... }:

let
  vars = import ../vars.nix;
  glances_path = "${vars.primary_docker}/glances";
in
{
  virtualisation.oci-containers.containers = {
    glances = {
      image = "nicolargo/glances:latest-full";
      extraOptions = [
        "--restart=always"
        "--pid=host"
        "--network=haproxy-net"
      ];
      volumes = [
        "/var/run/docker.sock:/var/run/docker.sock"
        "${glances_path}/glances.conf:/glances/conf/glances.conf"
      ];
      environment = {
        GLANCES_OPT = "-C /glances/conf/glances.conf -w";
      };
    };
  };
}