{ config, pkgs, nodes, hostFQDN, emailCheck, lib, ... }:
let
+ to_resource = func: cfg: lib.flatten (lib.optionals cfg.enable (lib.mapAttrsToList func cfg.profiles));
to_backup_age_dependency = name: profile: map (remote:
{
dependent_host_name = "eldiron.immae.eu";
contact_groups = "tiboqorl";
check_command = [ "check_https" "sc.groupe-cyllene.com" "/" "<title>Support Client Cyllene" ];
}
- ] ++ lib.flatten (lib.mapAttrsToList to_backup_age nodes.eldiron.config.services.duplyBackup.profiles);
+ ] ++ to_resource to_backup_age nodes.eldiron.config.services.duplyBackup;
contact = {
telio-tortay = config.myEnv.monitoring.contacts.telio-tortay // {
use = "generic-contact";
telio-tortay = { alias = "Telio Tortay"; members = "immae"; };
tiboqorl = { alias = "Tiboqorl"; members = "immae"; };
};
- servicedependency = lib.flatten (lib.mapAttrsToList to_backup_age_dependency nodes.eldiron.config.services.duplyBackup.profiles);
+ servicedependency = to_resource to_backup_age_dependency nodes.eldiron.config.services.duplyBackup;
}
myServices.ejabberd.enable = true;
myServices.vpn.enable = true;
services.pure-ftpd.enable = true;
- services.duplyBackup.enable = true;
+ services.duplyBackup.enable = false;
services.duplyBackup.profiles.oldies.rootDir = "/var/lib/oldies";
secrets.keys = [