mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
misc: allow null in extraPackages
This commit is contained in:
parent
c826d146c6
commit
f2f97d844b
13 changed files with 22 additions and 39 deletions
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
|
@ -34,9 +33,10 @@ in {
|
|||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
type = with types; listOf (nullOr package);
|
||||
default = [];
|
||||
description = "Extra packages to be made available to neovim";
|
||||
apply = builtins.filter (p: p != null);
|
||||
};
|
||||
|
||||
extraPython3Packages = mkOption {
|
||||
|
|
|
@ -150,6 +150,6 @@ with lib;
|
|||
`plugins.trouble.enable` is `false`.
|
||||
You should maybe enable the `trouble` plugin.
|
||||
'';
|
||||
extraPackages = optional (cfg.gitPackage != null) cfg.gitPackage;
|
||||
extraPackages = [cfg.gitPackage];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -36,9 +36,6 @@ with lib;
|
|||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraPackages =
|
||||
optional
|
||||
(cfg.godotPackage != null)
|
||||
cfg.godotPackage;
|
||||
extraPackages = [cfg.godotPackage];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -252,7 +252,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
extraPackages = optional (cfg.leanPackage != null) cfg.leanPackage;
|
||||
extraPackages = [cfg.leanPackage];
|
||||
|
||||
extraConfigLua = let
|
||||
setupOptions = with cfg;
|
||||
|
|
|
@ -48,7 +48,7 @@ with helpers.vim-plugin;
|
|||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraPackages = optional (cfg.ledgerPackage != null) cfg.ledgerPackage;
|
||||
extraPackages = [cfg.ledgerPackage];
|
||||
};
|
||||
|
||||
settingsOptions = {
|
||||
|
|
|
@ -133,7 +133,7 @@ in {
|
|||
};
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = with pkgs.vimPlugins; [nvim-lspconfig cfg.package];
|
||||
extraPackages = optional (cfg.serverPackage != null) cfg.serverPackage;
|
||||
extraPackages = [cfg.serverPackage];
|
||||
|
||||
plugins.lsp.postConfig = let
|
||||
options =
|
||||
|
|
|
@ -238,10 +238,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraPackages =
|
||||
optional
|
||||
(cfg.rustAnalyzerPackage != null)
|
||||
cfg.rustAnalyzerPackage;
|
||||
extraPackages = [cfg.rustAnalyzerPackage];
|
||||
|
||||
plugins.lsp.postConfig = let
|
||||
globalOptions = with cfg;
|
||||
|
|
|
@ -213,12 +213,11 @@ in {
|
|||
if cfg.nixGrammars
|
||||
then [(cfg.package.withPlugins (_: cfg.grammarPackages))]
|
||||
else [cfg.package];
|
||||
extraPackages = with pkgs;
|
||||
[
|
||||
extraPackages = with pkgs; [
|
||||
tree-sitter
|
||||
nodejs
|
||||
]
|
||||
++ optional (cfg.gccPackage != null) cfg.gccPackage;
|
||||
cfg.gccPackage
|
||||
];
|
||||
|
||||
opts = mkIf cfg.folding {
|
||||
foldmethod = "expr";
|
||||
|
|
|
@ -87,11 +87,9 @@ with lib;
|
|||
.${cfg.settings.view_method}
|
||||
or [];
|
||||
in
|
||||
(
|
||||
optional
|
||||
(cfg.texlivePackage != null)
|
||||
[
|
||||
cfg.texlivePackage
|
||||
)
|
||||
]
|
||||
++ viewerPackages;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -86,10 +86,7 @@
|
|||
config =
|
||||
mkIf cfg.enable
|
||||
{
|
||||
extraPackages =
|
||||
optional
|
||||
(cfg.package != null)
|
||||
cfg.package;
|
||||
extraPackages = [cfg.package];
|
||||
|
||||
plugins.lsp.enabledServers = [
|
||||
{
|
||||
|
|
|
@ -363,11 +363,9 @@ in {
|
|||
)
|
||||
enabledSources;
|
||||
plugins.gitsigns.enable = mkIf gitsignsEnabled true;
|
||||
extraPackages = builtins.filter (p: p != null) (
|
||||
builtins.map (
|
||||
source: source.package or null
|
||||
)
|
||||
enabledSources
|
||||
);
|
||||
extraPackages =
|
||||
map
|
||||
(source: source.package or null)
|
||||
enabledSources;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -134,10 +134,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraPackages =
|
||||
optional
|
||||
(cfg.clipboardPackage != null)
|
||||
cfg.clipboardPackage;
|
||||
extraPackages = [cfg.clipboardPackage];
|
||||
|
||||
extraConfigLua = let
|
||||
setupOptions =
|
||||
|
|
|
@ -271,7 +271,7 @@ in {
|
|||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
extraPackages = optional (cfg.ripgrepPackage != null) cfg.ripgrepPackage;
|
||||
extraPackages = [cfg.ripgrepPackage];
|
||||
extraConfigLua = ''
|
||||
require("todo-comments").setup${helpers.toLuaObject setupOptions}
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue