mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-23 20:25:08 +02:00
plugins/spectre: cleanup package options
This commit is contained in:
parent
e26f044339
commit
80150abad6
1 changed files with 32 additions and 17 deletions
|
@ -229,39 +229,54 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
||||||
|
|
||||||
extraOptions =
|
extraOptions =
|
||||||
let
|
let
|
||||||
userCommandSettings = config.plugins.spectre.settings.default;
|
defaults = config.plugins.spectre.settings.default;
|
||||||
|
|
||||||
|
# NOTE: changes here should also be reflected in the `defaultText` below
|
||||||
findPackages = {
|
findPackages = {
|
||||||
rg = pkgs.ripgrep;
|
rg = pkgs.ripgrep;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# NOTE: changes here should also be reflected in the `defaultText` below
|
||||||
replacePackages = {
|
replacePackages = {
|
||||||
sed = pkgs.gnused;
|
sed = pkgs.gnused;
|
||||||
inherit (pkgs) sd;
|
inherit (pkgs) sd;
|
||||||
};
|
};
|
||||||
|
|
||||||
# `toString` will turn `null` into `"null"` to allow for the attrs indexation.
|
|
||||||
findDefaultPackage = findPackages.${toString userCommandSettings.find.cmd} or null;
|
|
||||||
replaceDefaultPackage = replacePackages.${toString userCommandSettings.replace.cmd} or null;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
findPackage = helpers.mkPackageOption {
|
findPackage = lib.mkOption {
|
||||||
default = findDefaultPackage;
|
type = with lib.types; nullOr package;
|
||||||
description = ''
|
default = findPackages.${toString defaults.find.cmd} or null;
|
||||||
Which package to install for the find command.
|
defaultText = literalMD ''
|
||||||
Defaults to `pkgs.$\{settings.default.find.cmd}`.
|
Based on the value defined in `config.plugins.spectre.settings.default.find.cmd`,
|
||||||
|
if the value defined there is a key in the attrset below, then the corresponding value is used. Otherwise the default will be `null`.
|
||||||
|
|
||||||
Set to `null` to prevent the installation.
|
```nix
|
||||||
|
{
|
||||||
|
rg = pkgs.ripgrep;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
The package to use for the find command.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
replacePackage = helpers.mkPackageOption {
|
replacePackage = lib.mkOption {
|
||||||
default = replaceDefaultPackage;
|
type = with lib.types; nullOr package;
|
||||||
description = ''
|
default = replacePackages.${toString defaults.replace.cmd} or null;
|
||||||
Which package to install for the find command.
|
defaultText = literalMD ''
|
||||||
Defaults to `pkgs.$\{settings.default.replace.cmd}`.
|
Based on the value defined in `config.plugins.spectre.settings.default.replace.cmd`,
|
||||||
|
if the value defined there is a key in the attrset below, then the corresponding value is used. Otherwise the default will be `null`.
|
||||||
|
|
||||||
Set to `null` to prevent the installation.
|
```nix
|
||||||
|
{
|
||||||
|
sd = pkgs.sd;
|
||||||
|
sed = pkgs.gnused;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
The package to use for the replace command.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue