ildkule/mysqld_exporter: use nix-sops template for config
Some checks are pending
Eval nix flake / evals (push) Waiting to run
Some checks are pending
Eval nix flake / evals (push) Waiting to run
This commit is contained in:
@@ -1,7 +1,22 @@
|
||||
{ config, ... }: let
|
||||
cfg = config.services.prometheus;
|
||||
in {
|
||||
sops.secrets."config/mysqld_exporter" = { };
|
||||
sops = {
|
||||
secrets."config/mysqld_exporter_password" = { };
|
||||
|
||||
templates."mysqld_exporter.conf" = {
|
||||
restartUnits = [ "prometheus-mysqld-exporter.service" ];
|
||||
content = let
|
||||
inherit (config.sops) placeholder;
|
||||
in ''
|
||||
[client]
|
||||
host = bicep.pvv.ntnu.no
|
||||
port = 3306
|
||||
user = prometheus_mysqld_exporter
|
||||
password = ${placeholder."config/mysqld_exporter_password"}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.prometheus = {
|
||||
scrapeConfigs = [{
|
||||
@@ -19,7 +34,7 @@ in {
|
||||
|
||||
exporters.mysqld = {
|
||||
enable = true;
|
||||
configFile = config.sops.secrets."config/mysqld_exporter".path;
|
||||
configFile = config.sops.templates."mysqld_exporter.conf".path;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user