{ config, lib, pkgs, ... }: let inherit (lib) mkIf mkMerge mkThenElse; annuaire = config.r6d.machines; currentMachine = annuaire."${config.networking.hostName}"; flags = currentMachine.configurationFlags; in # TODO: changer adresse mail mkIf flags.munin { # Paquets environment.systemPackages = with pkgs; [ bc mailutils ]; # Services ## Noeud de supervision munin = pas de stockage des données locales services.munin-node = { enable = true; }; systemd.services.munin-node = { path = with pkgs; [ munin lm_sensors ]; serviceConfig.TimeoutStartSec = "3min"; }; users.extraUsers.munin = { #extraGroups = [ "postfix" "root" ]; extraGroups = [ "postfix" ]; }; # chmod a+rX -Rv /var/lib/postfix/queue/ ## Munin server -- generate /var/www/munin services.munin-cron = { enable = true; hosts = '' [${config.networking.hostName}] address 127.0.0.1 ''; extraGlobalConfig = '' contact.email.command ${pkgs.mutt}/bin/mutt -F /etc/nixos/base/services/munin-muttrc -s "Munin notification for ''${var:host}" root@prunetwork.fr ''; }; # Réseau networking.firewall = { allowedTCPPorts = [ #8000 ]; allowedUDPPorts = [ ]; }; }