treewide: convert package options to use mkPackageOption (#7116)

This commit converts `package = mkOption` declarations throughout the
codebase to use the more modern and consistent `lib.mkPackageOption`
function.

Key changes:
- Simple package options: `mkOption { type = types.package; default = pkgs.foo; }`
  becomes `lib.mkPackageOption pkgs "foo" { }`
- Package set options: Uses correct package set as first argument with
  `pkgsText` parameter (e.g., `lib.mkPackageOption pkgs.vimPlugins "plugin" { pkgsText = "pkgs.vimPlugins"; }`)
- Removes redundant descriptions that just restate the package name
- Preserves examples and extra context where meaningful
- Handles submodule plugin options properly with `null` defaults

This modernizes the option declarations and makes them more consistent
with current nixpkgs patterns while maintaining full backward compatibility.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-05-23 00:42:38 -05:00 committed by GitHub
parent a868570581
commit 7419250703
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
59 changed files with 93 additions and 383 deletions

View file

@ -152,12 +152,9 @@ in
readOnly = true;
};
packageConfigurable = mkOption {
type = types.package;
description = "Vim package to customize";
default = pkgs.vim-full or pkgs.vim_configurable;
defaultText = literalExpression "pkgs.vim-full";
example = literalExpression "pkgs.vim";
packageConfigurable = lib.mkPackageOption pkgs "vim-full" {
extraDescription = "Vim package to customize";
example = "pkgs.vim";
};
defaultEditor = mkOption {