about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2023-09-14 22:12:53 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2023-09-14 22:12:53 +0200
commit698c640e7751f538ae009c8f559b0408bbfec5b2 (patch)
tree8e3a4519cd2a08745da5d63e9613267dbc43fceb /nixos/modules/services/monitoring
parent2cd86bf59a9441072f9d557099d4b6385c3a4582 (diff)
downloadnixlib-698c640e7751f538ae009c8f559b0408bbfec5b2.tar
nixlib-698c640e7751f538ae009c8f559b0408bbfec5b2.tar.gz
nixlib-698c640e7751f538ae009c8f559b0408bbfec5b2.tar.bz2
nixlib-698c640e7751f538ae009c8f559b0408bbfec5b2.tar.lz
nixlib-698c640e7751f538ae009c8f559b0408bbfec5b2.tar.xz
nixlib-698c640e7751f538ae009c8f559b0408bbfec5b2.tar.zst
nixlib-698c640e7751f538ae009c8f559b0408bbfec5b2.zip
nixos/grafana: remove hacky deprecation helper from dashbaords & datasources
The problem we had back then was that `mkRenamedOptionModule` doesn't
work if an option will be moved a level depper, i.e.

    services.grafana.provision.dashboards

became

    services.grafana.provision.dashboards.settings.provider

I actually planned to remove this before 23.05 (since the change was
already released in 22.11), but as you can see that didn't happen ;-)

I think the grace-period was quite long already. And if someone is
migrating from <22.11 to a current NixOS now, there are very precise
instructions on how to upgrade in the 22.11 release notes.
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/grafana.nix24
1 files changed, 2 insertions, 22 deletions
diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix
index 571b9a3aeebd..e90a0e9d16db 100644
--- a/nixos/modules/services/monitoring/grafana.nix
+++ b/nixos/modules/services/monitoring/grafana.nix
@@ -88,26 +88,6 @@ let
   # Get a submodule without any embedded metadata:
   _filter = x: filterAttrs (k: v: k != "_module") x;
 
-  # FIXME(@Ma27) remove before 23.05. This is just a helper-type
-  # because `mkRenamedOptionModule` doesn't work if `foo.bar` is renamed
-  # to `foo.bar.baz`.
-  submodule' = module: types.coercedTo
-    (mkOptionType {
-      name = "grafana-provision-submodule";
-      description = "Wrapper-type for backwards compat of Grafana's declarative provisioning";
-      check = x:
-        if builtins.isList x then
-          throw ''
-            Provisioning dashboards and datasources declaratively by
-            setting `dashboards` or `datasources` to a list is not supported
-            anymore. Use `services.grafana.provision.datasources.settings.datasources`
-            (or `services.grafana.provision.dashboards.settings.providers`) instead.
-          ''
-        else isAttrs x || isFunction x;
-    })
-    id
-    (types.submodule module);
-
   # http://docs.grafana.org/administration/provisioning/#datasources
   grafanaTypes.datasourceConfig = types.submodule {
     freeformType = provisioningSettingsFormat.type;
@@ -1160,7 +1140,7 @@ in
           Declaratively provision Grafana's datasources.
         '';
         default = { };
-        type = submodule' {
+        type = types.submodule {
           options.settings = mkOption {
             description = lib.mdDoc ''
               Grafana datasource configuration in Nix. Can't be used with
@@ -1235,7 +1215,7 @@ in
           Declaratively provision Grafana's dashboards.
         '';
         default = { };
-        type = submodule' {
+        type = types.submodule {
           options.settings = mkOption {
             description = lib.mdDoc ''
               Grafana dashboard configuration in Nix. Can't be used with