fix mkif?

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2025-02-23 13:56:35 +01:00
parent 3ee515c390
commit c88320ba9a
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

View file

@ -6,15 +6,19 @@ let
text = cfg.prometheusCa;
};
yaml = pkgs.formats.yaml { };
nodeWebConfig = yaml.generate "prometheus-node-exporter-webconfig.yml" {
tls_server_config = {
client_ca_file = prometheusCaFile;
cert_file = cfg.prometheusNodeExporterCertFile;
key_file = cfg.prometheusNodeExporterCertKeyFile;
client_auth_type = "RequireAndVerifyClientCert";
client_allowed_sans = lib.mkIf (cfg.prometheusNodeExporterAllowScrapperSans != null) cfg.prometheusNodeExporterAllowScrapperSans;
};
};
nodeWebConfig = yaml.generate "prometheus-node-exporter-webconfig.yml" lib.mkMerge [
({
tls_server_config = {
client_ca_file = prometheusCaFile;
cert_file = cfg.prometheusNodeExporterCertFile;
key_file = cfg.prometheusNodeExporterCertKeyFile;
client_auth_type = "RequireAndVerifyClientCert";
};
})
(lib.mkIf (cfg.prometheusNodeExporterAllowScrapperSans != null) {
tls_server_config.client_allowed_sans = cfg.prometheusNodeExporterAllowScrapperSans;
})
];
in {
options.services.ppNodeExporter = {
prometheusCa = lib.mkOption {