helpers/mkPlugin: add default value for description (use name)

This commit is contained in:
Gaetan Lepage 2024-01-08 08:05:39 +01:00 committed by Gaétan Lepage
parent 97fb6d6a29
commit e3ef5dae2b

View file

@ -313,7 +313,7 @@ with lib; rec {
...
}: {
name,
description,
description ? null,
package ? null,
extraPlugins ? [],
extraPackages ? [],
@ -323,11 +323,6 @@ with lib; rec {
}: let
cfg = config.plugins.${name};
description =
if description is null
then name
else description;
# TODO support nested options!
pluginOptions =
mapAttrs
@ -374,7 +369,11 @@ with lib; rec {
in {
options.plugins.${name} =
{
enable = mkEnableOption description;
enable = mkEnableOption (
if description == null
then name
else description
);
}
// extraConfigOption
// packageOption