nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
18.86k stars 21.57k forks source link

Custom location of `lazy-lock.json` file #944

Closed timkoval closed 4 months ago

timkoval commented 4 months ago

Hey everyone,

I'm using nix package manager for every of my hardware but it makes config files directory read-only by it's concept. I've been using Astronvim before which uses lockfile = vim.fn.stdpath "data" .. "/lazy-lock.json" in user_opts to store lazy-lock.json in data directory.

Please tell me how I can pass lockfile location parameter to lazy in kickstart.nvim just to get the file saved in data directory?

dam9000 commented 4 months ago

Like this:

diff --git a/init.lua b/init.lua
index 88658ef..a175f2c 100644
--- a/init.lua
+++ b/init.lua
@@ -887,6 +887,7 @@ require('lazy').setup({
   --    For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
   -- { import = 'custom.plugins' },
 }, {
+  lockfile = vim.fn.stdpath 'data' .. '/lazy-lock.json',
   ui = {
     -- If you are using a Nerd Font: set icons to an empty table which will use the
     -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
dam9000 commented 4 months ago

So the "data" dir is ~/.local/share/nvim/, to me that looks like a better location for lazy-lock.json, I wonder why that is not the default? I'm considering to use that in my own config too. ... checking the readme:

It is recommended to have this file under version control.

I never do that as I update the plugins more frequently than I change the config and I don't want to bother making a git commit for each of these updates.

timkoval commented 4 months ago

@dam9000 Thank you so much! Now it works for me ✅ Will continue to dive into from-scratch configuration then :)