lib/options: remove deprecated package option helpers

`mkPackageOption` and `mkPluginPackageOption` have both been replaced
with nixpkg's `lib.mkPackageOption`.
This commit is contained in:
Matt Sturgeon 2024-09-05 01:39:11 +01:00
parent 7409e80bd2
commit fd923a3dd3
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 8 additions and 29 deletions

View file

@ -2,6 +2,12 @@
let
inherit (lib) types;
removed = lib.mapAttrs (name: msg: throw "${name} is removed. ${msg}") {
# Removed 2024-09-05
mkPackageOption = "Use `lib.mkPackageOption` instead.";
mkPluginPackageOption = "Use `lib.mkPackageOption` instead.";
};
# Render a plugin default string
pluginDefaultText =
{
@ -313,34 +319,6 @@ rec {
);
};
# TODO: Deprecated 2024-09-02; remove once all internal uses are gone
mkPackageOption =
args:
# A default package is required
assert args ? default;
# `name` must be present if `description` is missing
assert (!args ? description) -> args ? name;
mkNullOrOption' (
(lib.filterAttrs (n: _: n != "name") args)
// {
type = types.package;
description =
args.description or ''
Which package to use for `${args.name}`.
Set to `null` to disable its automatic installation.
'';
}
);
# TODO: Deprecated 2024-09-02; remove once all internal uses are gone
mkPluginPackageOption =
name: default:
lib.mkOption {
type = types.package;
inherit default;
description = "Which package to use for the ${name} plugin.";
};
mkSettingsOption =
{
options ? { },
@ -371,3 +349,4 @@ rec {
example;
};
}
// removed

View file

@ -8,7 +8,7 @@ let
message = "lib.nixvim should be defined";
}
{
assertion = lib.nixvim == helpers;
assertion = builtins.attrNames lib.nixvim == builtins.attrNames helpers;
message = "lib.nixvim and helpers should be aliases";
}
];