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
This commit is contained in:
Austin Horstman 2025-05-10 11:34:45 -05:00
parent dc5899978f
commit 0be2c246e3

View file

@ -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 != { }) {