From 7f7780daa55e8f2de87acc7563078a3db85e7feb Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Sun, 7 Nov 2021 19:04:24 +0000 Subject: [PATCH] nixos/prometheus: throw a helpful error when services.prometheus.environmentFile is defined --- nixos/doc/manual/from_md/release-notes/rl-2111.section.xml | 4 +++- nixos/doc/manual/release-notes/rl-2111.section.md | 2 +- nixos/modules/services/monitoring/prometheus/default.nix | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml index ebf4bd2bd5e5..d7dfcb5381cc 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml @@ -1809,7 +1809,9 @@ Superuser created successfully. services.prometheus.environmentFile has been removed since it was causing issues - and Prometheus now has native support for secret files. + and Prometheus now has native support for secret files, i.e. + basic_auth.password_file and + authorization.credentials_file. diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index c0b12b479a22..1c737542e7d2 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -508,7 +508,7 @@ In addition to numerous new and upgraded packages, this release has the followin - A new option `services.prometheus.enableReload` has been added which can be enabled to reload the prometheus service when its config file changes instead of restarting. -- The option `services.prometheus.environmentFile` has been removed since it was causing [issues](https://github.com/NixOS/nixpkgs/issues/126083) and Prometheus now has native support for secret files. +- The option `services.prometheus.environmentFile` has been removed since it was causing [issues](https://github.com/NixOS/nixpkgs/issues/126083) and Prometheus now has native support for secret files, i.e. `basic_auth.password_file` and `authorization.credentials_file`. - Dokuwiki now supports caddy! However - the nginx option has been removed, in the new configuration, please use the `dokuwiki.webserver = "nginx"` instead. diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index a35bf145308d..f20b8dde1abd 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -1554,6 +1554,8 @@ in imports = [ (mkRenamedOptionModule [ "services" "prometheus2" ] [ "services" "prometheus" ]) + (mkRemovedOptionModule [ "services" "prometheus" "environmentFile" ] + "It has been removed since it was causing issues (https://github.com/NixOS/nixpkgs/issues/126083) and Prometheus now has native support for secret files, i.e. `basic_auth.password_file` and `authorization.credentials_file`.") ]; options.services.prometheus = {