From 0be2c246e37a5b6e851111bfcf07ab37194e4954 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 10 May 2025 11:34:45 -0500 Subject: [PATCH] mako: deprecate criteria option This commit adds proper deprecation warnings and documentation for the 'criteria' option, guiding users to use the more flexible 'settings' option with nested attributes instead. - Added warning message when users use the deprecated option - Updated documentation with examples showing the new approach --- modules/services/mako.nix | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/modules/services/mako.nix b/modules/services/mako.nix index 38f03101..2436a636 100644 --- a/modules/services/mako.nix +++ b/modules/services/mako.nix @@ -131,6 +131,7 @@ in ''; }; criteria = mkOption { + visible = false; type = iniType; default = { }; example = { @@ -147,8 +148,21 @@ in }; }; description = '' - Criterias for mako's config. All the details can be found in the + Criteria for mako's config. All the details can be found in the CRITERIA section in the official documentation. + + *Deprecated*: Use `settings` with nested attributes instead. For example: + ```nix + settings = { + # Global settings + anchor = "top-right"; + + # Criteria sections + "actionable=true" = { + anchor = "top-left"; + }; + }; + ``` ''; }; }; @@ -158,6 +172,28 @@ in (lib.hm.assertions.assertPlatform "services.mako" pkgs lib.platforms.linux) ]; + warnings = lib.optional (cfg.criteria != { }) '' + The option `services.mako.criteria` is deprecated and will be removed in a future release. + Please use `services.mako.settings` with nested attributes instead. + + For example, instead of: + criteria = { + "actionable=true" = { + anchor = "top-left"; + }; + }; + + Use: + settings = { + # Global settings here... + + # Criteria sections + "actionable=true" = { + anchor = "top-left"; + }; + }; + ''; + home.packages = [ cfg.package ]; xdg.configFile."mako/config" = mkIf (cfg.settings != { } || cfg.criteria != { }) {