diff options
author | Shawn8901 <shawn8901@googlemail.com> | 2022-11-19 23:56:43 +0100 |
---|---|---|
committer | Shawn8901 <shawn8901@googlemail.com> | 2022-12-15 10:11:25 +0100 |
commit | 470247d433ddcb527e18b556660c13f7632779b3 (patch) | |
tree | c6384208929d02f5f44c361fdb251cdbd356ebfb /nixos | |
parent | 7634c3250b6870e76f2e611cb95b72392add9aef (diff) |
prometheus: Use yaml format generator instaed json for prometheus.yml
Additionally remove an unused variable
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/default.nix | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index f6bae8f9e9652..86d186be54a59 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -3,7 +3,7 @@ with lib; let - json = pkgs.formats.json { }; + yaml = pkgs.formats.yaml { }; cfg = config.services.prometheus; checkConfigEnabled = (lib.isBool cfg.checkConfig && cfg.checkConfig) @@ -11,8 +11,6 @@ let workingDir = "/var/lib/" + cfg.stateDir; - prometheusYmlOut = "${workingDir}/prometheus-substituted.yaml"; - triggerReload = pkgs.writeShellScriptBin "trigger-reload-prometheus" '' PATH="${makeBinPath (with pkgs; [ systemd ])}" if systemctl -q is-active prometheus.service; then @@ -38,7 +36,7 @@ let promtool ${what} $out '' else file; - generatedPrometheusYml = json.generate "prometheus.yml" promConfig; + generatedPrometheusYml = yaml.generate "prometheus.yml" promConfig; # This becomes the main config file for Prometheus promConfig = { |