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:
parent
a868570581
commit
7419250703
59 changed files with 93 additions and 383 deletions
|
|
@ -27,13 +27,7 @@ in
|
|||
{
|
||||
options.programs.lutris = {
|
||||
enable = mkEnableOption "lutris.";
|
||||
package = mkOption {
|
||||
default = pkgs.lutris;
|
||||
description = ''
|
||||
The lutris package to use.
|
||||
'';
|
||||
type = types.package;
|
||||
};
|
||||
package = lib.mkPackageOption pkgs "lutris" { };
|
||||
steamPackage = mkOption {
|
||||
default = null;
|
||||
example = "pkgs.steam or osConfig.programs.steam.package";
|
||||
|
|
|
|||
|
|
@ -48,9 +48,10 @@ let
|
|||
description = "Don't load by default (load with :packadd)";
|
||||
};
|
||||
|
||||
plugin = mkOption {
|
||||
type = types.package;
|
||||
description = "vim plugin";
|
||||
plugin = lib.mkPackageOption pkgs.vimPlugins "plugin" {
|
||||
default = null;
|
||||
example = "pkgs.vimPlugins.nvim-treesitter";
|
||||
pkgsText = "pkgs.vimPlugins";
|
||||
};
|
||||
|
||||
runtime = mkOption {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@ let
|
|||
|
||||
pluginModule = types.submodule {
|
||||
options = {
|
||||
plugin = mkOption {
|
||||
type = types.package;
|
||||
description = "Path of the configuration file to include.";
|
||||
plugin = lib.mkPackageOption pkgs.tmuxPlugins "plugin" {
|
||||
example = "pkgs.tmuxPlugins.sensible";
|
||||
default = null;
|
||||
pkgsText = "pkgs.tmuxPlugins";
|
||||
extraDescription = "Path of the configuration file to include.";
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue