This worked until I got this error from Lazy, my nvim package manager.
Error detected while processing /nix/store/j70xlivqkngjy2n8yd44mnahg9apv9yh-source/init.lua:
E5113: Error while calling lua chunk: ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/lock.lua:12: /home/redhawk/.config/nvim/lazy-lock.json: Read-only file system
stack traceback:
[C]: in function 'assert'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/lock.lua:12: in function 'update'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/init.lua:93: in function 'cb'
...cal/share/nvim/lazy/lazy.nvim/lua/lazy/manage/runner.lua:158: in function 'install'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:76: in function 'install_missing'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:44: in function 'setup'
...dhawk/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:100: in function 'setup'
/home/redhawk/.config/nvim/lua/package_manager.lua:14: in main chunk
[C]: in function 'require'
/nix/store/j70xlivqkngjy2n8yd44mnahg9apv9yh-source/init.lua:3: in main chunk
Press ENTER or type command to continue
While I know this is due to nix filesystem, I have no idea how to actually fix it.
I manage my neovim configs using home-manager. From my perspective, that means I acknowledge that any artifacts downloaded by home-manager are read-only, as that is how nix works.
It sounds like you want to re-use the configs across distros or platforms, and that makes sense. Could you just clone your repos into your home directory somewhere, then include them from your home-manager neovim config (using a lua require for instance)? The actual clone would be done manually, or in a shell script, or even in the neovim config. Would that serve you well?
Alternatively, you can keep the way you are doing it now, with the understanding that the cloned repo in the nix store isn’t the one you edit. Instead, you edit another repo clone, then commit and push, then run home-manager switch to update. I hope that makes sense.
Personally, when I switched to home-manager, I decided to use home-manager across distros, so my home-manager repo is the source of truth for my neovim configs.
I had the same exact issue with updating lazy-lock.json. The best solution I found is to use mkOutOfStoreSymLink with home-manager (see discussion I found). I have this in my config: