From b5847455066d0191cebd6b140531cc154443e316 Mon Sep 17 00:00:00 2001 From: Robbert Gurdeep Singh Date: Sat, 10 Oct 2020 16:15:42 +0200 Subject: [PATCH] neovim: add extraPackages (#1522) Add an option to add packages to the PATH of nvim. This may be usefull to make extra programes availible for plugins and/or for usage in :! myprogram --- modules/programs/neovim.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index 48421aed6..fd45de852 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -54,7 +54,8 @@ let // optionalAttrs (cfg.plugins != [] ) { packages.home-manager.start = map (x: x.plugin or x) cfg.plugins; }; - + extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != []) + '' --prefix PATH : "${lib.makeBinPath cfg.extraPackages}"''; in { @@ -200,6 +201,13 @@ in ''; }; + extraPackages = mkOption { + type = with types; listOf package; + default = [ ]; + example = "[ pkgs.shfmt ]"; + description = "Extra packages available to nvim."; + }; + plugins = mkOption { type = with types; listOf (either package pluginWithConfigType); default = [ ]; @@ -241,6 +249,7 @@ in extraPythonPackages withPython withNodeJs withRuby viAlias vimAlias; + extraMakeWrapperArgs = extraMakeWrapperArgs; configure = cfg.configure // moduleConfigure; };