From 9424d0d6a52f7652f0c3c0c02ba0722f39920b87 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Mon, 7 Oct 2024 18:02:56 +0200 Subject: [PATCH] wrapper: remove disableDefaultRuntimePaths accidental leak of user config is no longer possible since we now use $NVIM_APP_NAME --- modules/wrapper/rc/options.nix | 39 ++++------------------------------ 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 70ab2a8a..46fbe394 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -20,6 +20,10 @@ in { See the v0.7 release notes for more information on how to migrate your existing configurations. '') + (mkRemovedOptionModule ["vim" "disableDefaultRuntimePaths"] '' + Nvf now uses $NVIM_APP_NAME so there is no longer the problem of + (accidental) leaking of user configuration. + '') ]; options.vim = { @@ -36,26 +40,6 @@ in { take a look at the [{option}`official documentation`](https://neovim.io/doc/user/lua.html#vim.loader.enable()). ''; - disableDefaultRuntimePaths = mkOption { - type = bool; - default = true; - example = false; - description = '' - Disables the default runtime paths that are set by Neovim - when it starts up. This is useful when you want to have - full control over the runtime paths that are set by Neovim. - - ::: {.note} - To avoid leaking imperative user configuration into your - configuration, this is enabled by default. If you wish - to load configuration from user configuration directories - (e.g. {file}`$HOME/.config/nvim`, {file}`$HOME/.config/nvim/after` - and {file}`$HOME/.local/share/nvim/site`) you may set this - option to true. - ::: - ''; - }; - additionalRuntimePaths = mkOption { type = listOf (either path str); default = []; @@ -180,21 +164,6 @@ in { vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths}) ''} - ${optionalString cfg.disableDefaultRuntimePaths '' - -- Remove default user runtime paths from the - -- `runtimepath` option to avoid leaking user configuration - -- into the final neovim wrapper - local defaultRuntimePaths = { - vim.fn.stdpath('config'), -- $HOME/.config/nvim - vim.fn.stdpath('config') .. "/after", -- $HOME/.config/nvim/after - vim.fn.stdpath('data') .. "/site", -- $HOME/.local/share/nvim/site - } - - for _, path in ipairs(defaultRuntimePaths) do - vim.opt.runtimepath:remove(path) - end - ''} - ${optionalString cfg.enableLuaLoader "vim.loader.enable()"} '';