From f3f4ed83ca4932102cf144669c1ba428da92aac5 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Fri, 1 Mar 2024 13:06:41 +0000 Subject: [PATCH 1/4] lazy.nvim plugin manager --- plugins/default.nix | 1 + plugins/filetrees/nvim-tree.nix | 2 +- plugins/pluginmanagers/lazy.nix | 216 ++++++++++++++++++ .../plugins/pluginmanagers/lazy.nix | 81 +++++++ 4 files changed, 299 insertions(+), 1 deletion(-) create mode 100644 plugins/pluginmanagers/lazy.nix create mode 100644 tests/test-sources/plugins/pluginmanagers/lazy.nix diff --git a/plugins/default.nix b/plugins/default.nix index a5ba6b4c0..5e94171cd 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -94,6 +94,7 @@ ./dap ./pluginmanagers/packer.nix + ./pluginmanagers/lazy.nix ./snippets/friendly-snippets.nix ./snippets/luasnip diff --git a/plugins/filetrees/nvim-tree.nix b/plugins/filetrees/nvim-tree.nix index a4c735abd..a5de01f72 100644 --- a/plugins/filetrees/nvim-tree.nix +++ b/plugins/filetrees/nvim-tree.nix @@ -759,7 +759,7 @@ in { helpers.defaultNullOpts.mkNullable (with types; attrsOf (listOf str)) '' { - filetype = [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ]; + filetype = [ "notify" "lazy" "packer" "qf" "diff" "fugitive" "fugitiveblame" ]; buftype = [ "nofile" "terminal" "help" ]; }; '' diff --git a/plugins/pluginmanagers/lazy.nix b/plugins/pluginmanagers/lazy.nix new file mode 100644 index 000000000..ade41f001 --- /dev/null +++ b/plugins/pluginmanagers/lazy.nix @@ -0,0 +1,216 @@ +{ + lib, + helpers, + config, + pkgs, + ... +}: +with lib; let + cfg = config.plugins.lazy; + lazyPlugins = cfg.plugins; + + processPlugin = plugin: let + mkEntryFromDrv = p: + if lib.isDerivation p + then { + name = "${lib.getName p}"; + path = p; + } + else { + name = "${lib.getName p.pkg}"; + path = p.pkg; + }; + processDependencies = + if plugin ? dependencies && plugin.dependencies != null + then builtins.concatMap processPlugin plugin.dependencies + else []; + in + [(mkEntryFromDrv plugin)] ++ processDependencies; + + processedPlugins = builtins.concatLists (builtins.map processPlugin lazyPlugins); + lazyPath = pkgs.linkFarm "lazy-plugins" processedPlugins; +in { + options = { + plugins.lazy = { + enable = mkEnableOption "lazy.nvim"; + + plugins = with types; let + pluginType = + either + package + (submodule { + options = { + dir = helpers.mkNullOrOption str "A directory pointing to a local plugin"; + + pkg = mkOption { + type = package; + description = "Vim plugin to install"; + }; + + name = helpers.mkNullOrOption str "Name of the plugin to install"; + + dev = helpers.defaultNullOpts.mkBool false "When true, a local plugin directory will be used instead. See config.dev"; + + lazy = helpers.defaultNullOpts.mkBool true "When true, the plugin will only be loaded when needed. Lazy-loaded plugins are automatically loaded when their Lua modules are required, or when one of the lazy-loading handlers triggers"; + + enabled = helpers.defaultNullOpts.mkBool true "When false then this plugin will not be included in the spec"; + + cond = + helpers.mkNullOrOption + (oneOf [ + str + helpers.nixvimTypes.rawLua + (listOf (either str helpers.nixvimTypes.rawLua)) + ]) + "When false, or if the function returns false, then this plugin will not be loaded. Useful to disable some plugins in vscode, or firenvim for example."; + + dependencies = + helpers.mkNullOrOption (helpers.nixvimTypes.eitherRecursive str listOfPlugins) + "Plugin dependencies"; + + init = + helpers.mkNullOrOption (either bool helpers.nixvimTypes.rawLua) + "init functions are always executed during startup"; + + config = + helpers.mkNullOrOption (either bool helpers.nixvimTypes.rawLua) + "config is executed when the plugin loads. The default implementation will automatically run require(MAIN).setup(opts). Lazy uses several heuristics to determine the plugin's MAIN module automatically based on the plugin's name. See also opts. To use the default implementation without opts set config to true."; + + main = helpers.mkNullOrOption str "You can specify the main module to use for config() and opts(), in case it can not be determined automatically. See config()"; + + build = + helpers.mkNullOrOption + (oneOf [ + (either str (listOf str)) + helpers.nixvimTypes.rawLua + ]) + "build is executed when a plugin is installed or updated. Before running build, a plugin is first loaded. If it's a string it will be ran as a shell command. When prefixed with : it is a Neovim command. You can also specify a list to executed multiple build commands. Some plugins provide their own build.lua which is automatically used by lazy. So no need to specify a build step for those plugins."; + + submodules = helpers.defaultNullOpts.mkBool true "When false, git submodules will not be fetched. Defaults to true"; + + event = + helpers.mkNullOrOption + (oneOf [ + (either str (listOf str)) + helpers.nixvimTypes.rawLua + ]) + "Lazy-load on event. Events can be specified as BufEnter or with a pattern like BufEnter *.lua"; + + cmd = + helpers.mkNullOrOption + (oneOf [ + (either str (listOf str)) + helpers.nixvimTypes.rawLua + ]) + "Lazy-load on command"; + + ft = + helpers.mkNullOrOption + (oneOf [ + (either str (listOf str)) + helpers.nixvimTypes.rawLua + ]) + "Lazy-load on filetype"; + + keys = + helpers.mkNullOrOption + (oneOf [ + (either str (listOf str)) + helpers.nixvimTypes.rawLua + ]) + "Lazy-load on key mapping"; + + module = helpers.defaultNullOpts.mkBool false "Do not automatically load this Lua module when it's required somewhere"; + + priority = helpers.defaultNullOpts.mkNum null "Only useful for start plugins (lazy=false) to force loading certain plugins first. Default priority is 50. It's recommended to set this to a high number for colorschemes."; + + optional = helpers.defaultNullOpts.mkBool false "When a spec is tagged optional, it will only be included in the final spec, when the same plugin has been specified at least once somewhere else without optional. This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part of the user's plugins"; + + opts = helpers.mkNullOrOption (either attrs helpers.nixvimTypes.rawLua) "opts should be a table (will be merged with parent specs), return a table (replaces parent specs) or should change a table. The table will be passed to the Plugin.config() function. Setting this value will imply Plugin.config()"; + }; + }); + + listOfPlugins = types.listOf pluginType; + in + mkOption { + type = listOfPlugins; + default = []; + description = "List of plugins"; + }; + }; + }; + + config = mkIf cfg.enable { + extraPlugins = [(pkgs.vimPlugins.lazy-nvim.overrideAttrs (_: {pname = "lazy.nvim";}))]; + extraPackages = [pkgs.git]; + + extraConfigLua = let + pluginToLua = plugin: let + keyExists = keyToCheck: attrSet: lib.elem keyToCheck (lib.attrNames attrSet); + in + if isDerivation plugin + then { + dir = "${lazyPath}/${lib.getName plugin}"; + } + else { + "__unkeyed" = plugin.name; + + inherit + (plugin) + build + cmd + cond + config + dev + enabled + event + ft + init + keys + lazy + main + module + name + optional + opts + priority + submodules + ; + + dependencies = + helpers.ifNonNull' plugin.dependencies + ( + if isList plugin.dependencies + then (pluginListToLua plugin.dependencies) + else plugin.dependencies + ); + + dir = + if plugin ? dir && plugin.dir != null + then plugin.dir + else "${lazyPath}/${lib.getName plugin.pkg}"; + }; + + pluginListToLua = map pluginToLua; + + plugins = pluginListToLua cfg.plugins; + + packedPlugins = + if length plugins == 1 + then head plugins + else plugins; + in + mkIf (cfg.plugins != []) '' + require('lazy').setup( + { + dev = { + path = "${lazyPath}", + patterns = {"."}, + fallback = false + }, + spec = ${helpers.toLuaObject packedPlugins} + } + ) + ''; + }; +} diff --git a/tests/test-sources/plugins/pluginmanagers/lazy.nix b/tests/test-sources/plugins/pluginmanagers/lazy.nix new file mode 100644 index 000000000..d85dda298 --- /dev/null +++ b/tests/test-sources/plugins/pluginmanagers/lazy.nix @@ -0,0 +1,81 @@ +{pkgs, ...}: { + # Empty configuration + empty = { + plugins.lazy.enable = true; + }; + + test = { + plugins.lazy = with pkgs.vimPlugins; { + enable = true; + + plugins = [ + vim-closer + + # Load on specific commands + { + pkg = vim-dispatch; + optional = true; + cmd = ["Dispatch" "Make" "Focus" "Start"]; + } + + # Load on an autocommand event + { + pkg = vim-matchup; + event = "VimEnter"; + } + + # Load on a combination of conditions: specific filetypes or commands + # Also run code after load (see the "config" key) + { + pkg = ale; + name = "w0rp/ale"; + ft = ["sh" "zsh" "bash" "c" "cpp" "cmake" "html" "markdown" "racket" "vim" "tex"]; + cmd = "ALEEnable"; + } + + # Plugins can have dependencies on other plugins + { + pkg = completion-nvim; + optional = true; + dependencies = [ + { + pkg = vim-vsnip; + optional = true; + } + { + pkg = vim-vsnip-integ; + optional = true; + } + ]; + } + + # Plugins can have post-install/update hooks + { + pkg = markdown-preview-nvim; + build = "cd app && yarn install"; + cmd = "MarkdownPreview"; + } + + # Post-install/update hook with neovim command + { + pkg = nvim-treesitter; + build = ":TSUpdate"; + opts = {ensure_installed = {};}; + } + + # Post-install/update hook with call of vimscript function with argument + { + pkg = firenvim; + build.__raw = ''function() vim.fn["firenvim#install"](0) end''; + } + + # Use dependency and run lua function after load + { + pkg = gitsigns-nvim; + dependencies = [plenary-nvim]; + config.__raw = ''function() require("gitsigns").setup() end''; + } + ]; + }; + }; +} From f7d26863823f0875e7e3623c09bf469426c9e682 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Sat, 2 Mar 2024 15:42:39 +0000 Subject: [PATCH 2/4] Addressing change requests and recommendations --- plugins/pluginmanagers/lazy.nix | 59 +++++-------------- .../plugins/pluginmanagers/lazy.nix | 8 --- 2 files changed, 15 insertions(+), 52 deletions(-) diff --git a/plugins/pluginmanagers/lazy.nix b/plugins/pluginmanagers/lazy.nix index ade41f001..9fb1c4bb4 100644 --- a/plugins/pluginmanagers/lazy.nix +++ b/plugins/pluginmanagers/lazy.nix @@ -56,12 +56,7 @@ in { enabled = helpers.defaultNullOpts.mkBool true "When false then this plugin will not be included in the spec"; cond = - helpers.mkNullOrOption - (oneOf [ - str - helpers.nixvimTypes.rawLua - (listOf (either str helpers.nixvimTypes.rawLua)) - ]) + helpers.mkNullOrOption (helpers.nixvimTypes.maybeRaw bool) "When false, or if the function returns false, then this plugin will not be loaded. Useful to disable some plugins in vscode, or firenvim for example."; dependencies = @@ -69,64 +64,41 @@ in { "Plugin dependencies"; init = - helpers.mkNullOrOption (either bool helpers.nixvimTypes.rawLua) + helpers.mkNullOrOption (helpers.nixvimTypes.maybeRaw bool) "init functions are always executed during startup"; config = - helpers.mkNullOrOption (either bool helpers.nixvimTypes.rawLua) + helpers.mkNullOrOption (helpers.nixvimTypes.maybeRaw bool) "config is executed when the plugin loads. The default implementation will automatically run require(MAIN).setup(opts). Lazy uses several heuristics to determine the plugin's MAIN module automatically based on the plugin's name. See also opts. To use the default implementation without opts set config to true."; main = helpers.mkNullOrOption str "You can specify the main module to use for config() and opts(), in case it can not be determined automatically. See config()"; - build = - helpers.mkNullOrOption - (oneOf [ - (either str (listOf str)) - helpers.nixvimTypes.rawLua - ]) - "build is executed when a plugin is installed or updated. Before running build, a plugin is first loaded. If it's a string it will be ran as a shell command. When prefixed with : it is a Neovim command. You can also specify a list to executed multiple build commands. Some plugins provide their own build.lua which is automatically used by lazy. So no need to specify a build step for those plugins."; - submodules = helpers.defaultNullOpts.mkBool true "When false, git submodules will not be fetched. Defaults to true"; - event = - helpers.mkNullOrOption - (oneOf [ - (either str (listOf str)) - helpers.nixvimTypes.rawLua - ]) + event = with helpers.nixvimTypes; + helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) "Lazy-load on event. Events can be specified as BufEnter or with a pattern like BufEnter *.lua"; - cmd = - helpers.mkNullOrOption - (oneOf [ - (either str (listOf str)) - helpers.nixvimTypes.rawLua - ]) + cmd = with helpers.nixvimTypes; + helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) "Lazy-load on command"; - ft = - helpers.mkNullOrOption - (oneOf [ - (either str (listOf str)) - helpers.nixvimTypes.rawLua - ]) + ft = with helpers.nixvimTypes; + helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) "Lazy-load on filetype"; - keys = - helpers.mkNullOrOption - (oneOf [ - (either str (listOf str)) - helpers.nixvimTypes.rawLua - ]) + keys = with helpers.nixvimTypes; + helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) "Lazy-load on key mapping"; module = helpers.defaultNullOpts.mkBool false "Do not automatically load this Lua module when it's required somewhere"; - priority = helpers.defaultNullOpts.mkNum null "Only useful for start plugins (lazy=false) to force loading certain plugins first. Default priority is 50. It's recommended to set this to a high number for colorschemes."; + priority = helpers.mkNullOrOption number "Only useful for start plugins (lazy=false) to force loading certain plugins first. Default priority is 50. It's recommended to set this to a high number for colorschemes."; optional = helpers.defaultNullOpts.mkBool false "When a spec is tagged optional, it will only be included in the final spec, when the same plugin has been specified at least once somewhere else without optional. This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part of the user's plugins"; - opts = helpers.mkNullOrOption (either attrs helpers.nixvimTypes.rawLua) "opts should be a table (will be merged with parent specs), return a table (replaces parent specs) or should change a table. The table will be passed to the Plugin.config() function. Setting this value will imply Plugin.config()"; + opts = with helpers.nixvimTypes; + helpers.mkNullOrOption (maybeRaw (attrsOf anything)) "opts should be a table (will be merged with parent specs), return a table (replaces parent specs) or should change a table. The table will be passed to the Plugin.config() function. Setting this value will imply Plugin.config()"; }; }); @@ -141,7 +113,7 @@ in { }; config = mkIf cfg.enable { - extraPlugins = [(pkgs.vimPlugins.lazy-nvim.overrideAttrs (_: {pname = "lazy.nvim";}))]; + extraPlugins = [pkgs.vimPlugins.lazy-nvim]; extraPackages = [pkgs.git]; extraConfigLua = let @@ -157,7 +129,6 @@ in { inherit (plugin) - build cmd cond config diff --git a/tests/test-sources/plugins/pluginmanagers/lazy.nix b/tests/test-sources/plugins/pluginmanagers/lazy.nix index d85dda298..286be1c44 100644 --- a/tests/test-sources/plugins/pluginmanagers/lazy.nix +++ b/tests/test-sources/plugins/pluginmanagers/lazy.nix @@ -52,23 +52,15 @@ # Plugins can have post-install/update hooks { pkg = markdown-preview-nvim; - build = "cd app && yarn install"; cmd = "MarkdownPreview"; } # Post-install/update hook with neovim command { pkg = nvim-treesitter; - build = ":TSUpdate"; opts = {ensure_installed = {};}; } - # Post-install/update hook with call of vimscript function with argument - { - pkg = firenvim; - build.__raw = ''function() vim.fn["firenvim#install"](0) end''; - } - # Use dependency and run lua function after load { pkg = gitsigns-nvim; From 326c337128fe17cee7ac222d1854ce7643ee98f9 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Sat, 2 Mar 2024 20:18:11 +0000 Subject: [PATCH 3/4] Refactor use of maybeRaw with either --- plugins/pluginmanagers/lazy.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/pluginmanagers/lazy.nix b/plugins/pluginmanagers/lazy.nix index 9fb1c4bb4..e3903f0a0 100644 --- a/plugins/pluginmanagers/lazy.nix +++ b/plugins/pluginmanagers/lazy.nix @@ -76,19 +76,19 @@ in { submodules = helpers.defaultNullOpts.mkBool true "When false, git submodules will not be fetched. Defaults to true"; event = with helpers.nixvimTypes; - helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) + helpers.mkNullOrOption (maybeRaw (either str (listOf str))) "Lazy-load on event. Events can be specified as BufEnter or with a pattern like BufEnter *.lua"; cmd = with helpers.nixvimTypes; - helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) + helpers.mkNullOrOption (maybeRaw (either str (listOf str))) "Lazy-load on command"; ft = with helpers.nixvimTypes; - helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) + helpers.mkNullOrOption (maybeRaw (either str (listOf str))) "Lazy-load on filetype"; keys = with helpers.nixvimTypes; - helpers.mkNullOrOption (either (maybeRaw str) (maybeRaw (listOf str))) + helpers.mkNullOrOption (maybeRaw (either str (listOf str))) "Lazy-load on key mapping"; module = helpers.defaultNullOpts.mkBool false "Do not automatically load this Lua module when it's required somewhere"; From 8390ce5856c428e32a33c5c860be84a1a2c52039 Mon Sep 17 00:00:00 2001 From: Christian Kemper Date: Mon, 4 Mar 2024 23:08:54 +0000 Subject: [PATCH 4/4] addressing remarks and change requests --- plugins/pluginmanagers/lazy.nix | 67 ++++++++++++++----- .../plugins/pluginmanagers/lazy.nix | 3 +- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/plugins/pluginmanagers/lazy.nix b/plugins/pluginmanagers/lazy.nix index e3903f0a0..106cb6bc3 100644 --- a/plugins/pluginmanagers/lazy.nix +++ b/plugins/pluginmanagers/lazy.nix @@ -49,31 +49,53 @@ in { name = helpers.mkNullOrOption str "Name of the plugin to install"; - dev = helpers.defaultNullOpts.mkBool false "When true, a local plugin directory will be used instead. See config.dev"; + dev = helpers.defaultNullOpts.mkBool false '' + When true, a local plugin directory will be used instead. + See config.dev + ''; - lazy = helpers.defaultNullOpts.mkBool true "When true, the plugin will only be loaded when needed. Lazy-loaded plugins are automatically loaded when their Lua modules are required, or when one of the lazy-loading handlers triggers"; + lazy = helpers.defaultNullOpts.mkBool true '' + When true, the plugin will only be loaded when needed. + Lazy-loaded plugins are automatically loaded when their Lua modules are required, + or when one of the lazy-loading handlers triggers + ''; - enabled = helpers.defaultNullOpts.mkBool true "When false then this plugin will not be included in the spec"; + enabled = helpers.defaultNullOpts.mkStrLuaFnOr types.bool "`true`" '' + When false then this plugin will not be included in the spec. (accepts fun():boolean) + ''; cond = - helpers.mkNullOrOption (helpers.nixvimTypes.maybeRaw bool) - "When false, or if the function returns false, then this plugin will not be loaded. Useful to disable some plugins in vscode, or firenvim for example."; + helpers.defaultNullOpts.mkStrLuaFnOr types.bool "`true`" + '' + When false, or if the function returns false, + then this plugin will not be loaded. Useful to disable some plugins in vscode, + or firenvim for example. (accepts fun(LazyPlugin):boolean) + ''; dependencies = helpers.mkNullOrOption (helpers.nixvimTypes.eitherRecursive str listOfPlugins) "Plugin dependencies"; init = - helpers.mkNullOrOption (helpers.nixvimTypes.maybeRaw bool) + helpers.mkNullOrLuaFn "init functions are always executed during startup"; - config = - helpers.mkNullOrOption (helpers.nixvimTypes.maybeRaw bool) - "config is executed when the plugin loads. The default implementation will automatically run require(MAIN).setup(opts). Lazy uses several heuristics to determine the plugin's MAIN module automatically based on the plugin's name. See also opts. To use the default implementation without opts set config to true."; + config = helpers.mkNullOrStrLuaFnOr (types.enum [true]) '' + config is executed when the plugin loads. + The default implementation will automatically run require(MAIN).setup(opts). + Lazy uses several heuristics to determine the plugin's MAIN module automatically based on the plugin's name. + See also opts. To use the default implementation without opts set config to true. + ''; - main = helpers.mkNullOrOption str "You can specify the main module to use for config() and opts(), in case it can not be determined automatically. See config()"; + main = helpers.mkNullOrOption str '' + You can specify the main module to use for config() and opts(), + in case it can not be determined automatically. See config() + ''; - submodules = helpers.defaultNullOpts.mkBool true "When false, git submodules will not be fetched. Defaults to true"; + submodules = helpers.defaultNullOpts.mkBool true '' + When false, git submodules will not be fetched. + Defaults to true + ''; event = with helpers.nixvimTypes; helpers.mkNullOrOption (maybeRaw (either str (listOf str))) @@ -91,14 +113,29 @@ in { helpers.mkNullOrOption (maybeRaw (either str (listOf str))) "Lazy-load on key mapping"; - module = helpers.defaultNullOpts.mkBool false "Do not automatically load this Lua module when it's required somewhere"; + module = helpers.mkNullOrOption (enum [false]) '' + Do not automatically load this Lua module when it's required somewhere + ''; - priority = helpers.mkNullOrOption number "Only useful for start plugins (lazy=false) to force loading certain plugins first. Default priority is 50. It's recommended to set this to a high number for colorschemes."; + priority = helpers.mkNullOrOption number '' + Only useful for start plugins (lazy=false) to force loading certain plugins first. + Default priority is 50. It's recommended to set this to a high number for colorschemes. + ''; - optional = helpers.defaultNullOpts.mkBool false "When a spec is tagged optional, it will only be included in the final spec, when the same plugin has been specified at least once somewhere else without optional. This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part of the user's plugins"; + optional = helpers.defaultNullOpts.mkBool false '' + When a spec is tagged optional, it will only be included in the final spec, + when the same plugin has been specified at least once somewhere else without optional. + This is mainly useful for Neovim distros, to allow setting options on plugins that may/may not be part + of the user's plugins + ''; opts = with helpers.nixvimTypes; - helpers.mkNullOrOption (maybeRaw (attrsOf anything)) "opts should be a table (will be merged with parent specs), return a table (replaces parent specs) or should change a table. The table will be passed to the Plugin.config() function. Setting this value will imply Plugin.config()"; + helpers.mkNullOrOption (maybeRaw (attrsOf anything)) '' + opts should be a table (will be merged with parent specs), + return a table (replaces parent specs) or should change a table. + The table will be passed to the Plugin.config() function. + Setting this value will imply Plugin.config() + ''; }; }); diff --git a/tests/test-sources/plugins/pluginmanagers/lazy.nix b/tests/test-sources/plugins/pluginmanagers/lazy.nix index 286be1c44..8dc56e08c 100644 --- a/tests/test-sources/plugins/pluginmanagers/lazy.nix +++ b/tests/test-sources/plugins/pluginmanagers/lazy.nix @@ -25,7 +25,6 @@ } # Load on a combination of conditions: specific filetypes or commands - # Also run code after load (see the "config" key) { pkg = ale; name = "w0rp/ale"; @@ -65,7 +64,7 @@ { pkg = gitsigns-nvim; dependencies = [plenary-nvim]; - config.__raw = ''function() require("gitsigns").setup() end''; + config = ''function() require("gitsigns").setup() end''; } ]; };