mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01:00
neovim: suffix path with extraPackages (#1756)
* neovim: suffix path with extraPackages * neovim: avoid generating empty blocks in config * fix(neovim): install plugin regardless if there is config
This commit is contained in:
parent
d420287583
commit
fc87ac92af
1 changed files with 13 additions and 16 deletions
|
@ -43,29 +43,28 @@ let
|
||||||
|
|
||||||
# A function to get the configuration string (if any) from an element of 'plugins'
|
# A function to get the configuration string (if any) from an element of 'plugins'
|
||||||
pluginConfig = p:
|
pluginConfig = p:
|
||||||
if builtins.hasAttr "plugin" p && builtins.hasAttr "config" p then ''
|
if p ? plugin && (p.config or "") != "" then ''
|
||||||
" ${p.plugin.pname} {{{
|
" ${p.plugin.pname} {{{
|
||||||
${p.config}
|
${p.config}
|
||||||
" }}}
|
" }}}
|
||||||
'' else
|
'' else
|
||||||
"";
|
"";
|
||||||
|
|
||||||
moduleConfigure = optionalAttrs (cfg.extraConfig != ""
|
moduleConfigure = {
|
||||||
|| (lib.filter (hasAttr "config") cfg.plugins) != [ ]) {
|
packages.home-manager = {
|
||||||
customRC = cfg.extraConfig
|
start = filter (f: f != null) (map
|
||||||
+ pkgs.lib.concatMapStrings pluginConfig cfg.plugins;
|
(x: if x ? plugin && x.optional == true then null else (x.plugin or x))
|
||||||
|
cfg.plugins);
|
||||||
packages.home-manager = {
|
opt = filter (f: f != null)
|
||||||
start = filter (f: f != null) (map (x:
|
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
|
||||||
if x ? plugin && x.optional == true then null else (x.plugin or x))
|
|
||||||
cfg.plugins);
|
cfg.plugins);
|
||||||
opt = filter (f: f != null)
|
|
||||||
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
|
|
||||||
cfg.plugins);
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
customRC = cfg.extraConfig
|
||||||
|
+ pkgs.lib.concatMapStrings pluginConfig cfg.plugins;
|
||||||
|
};
|
||||||
|
|
||||||
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
|
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
|
||||||
''--prefix PATH : "${lib.makeBinPath cfg.extraPackages}"'';
|
''--suffix PATH : "${lib.makeBinPath cfg.extraPackages}"'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
|
@ -242,8 +241,6 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
|
|
||||||
''--prefix PATH : "${lib.makeBinPath cfg.extraPackages}"'';
|
|
||||||
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
|
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
|
||||||
inherit (cfg)
|
inherit (cfg)
|
||||||
extraPython3Packages withPython3 extraPythonPackages withPython
|
extraPython3Packages withPython3 extraPythonPackages withPython
|
||||||
|
|
Loading…
Reference in a new issue