Replies: 2 comments 2 replies
-
|
Hey again 😄 Thanks for the suggestion and for sharing your progress.
The reason I split out the |
Beta Was this translation helpful? Give feedback.
-
|
It works when I pass an absolute path as a raw string, just typed in manually. The nvim config is applied every time I change init.lua and restart nvim without rebuild nvimConfig =
let stored = configPath;
target = "/home/slava/workspaces-one/25-dotfiles/25.01-dotfiles/neovim/nvim/";
mutable = runCommandLocal
"kickstart-config-symlink" {}
''ln -s ${lib.escapeShellArg (target)} $out'';
in
if mutableConfig then mutable else stored;But when I reference the directory as a path, then it is stored in nix store. Even if it's coerced to string, and modified target = "/" + (substring 1 (-1) (toString ./nvim)) + "/";I borrowed the code from home-manager's out-of-store link. I believe it must be the best code for out-of-store links :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
UPD
Ah,
./nvimactually means the copy of./nvimstored in nix store 🤔I'm looking for another solution
Context:
With
wrapRc=falsewe have basic ability to edit neovim config and apply changes without rebuild. But./nvimfrom flake to~/.config/${NVIM_APPNAME}~/.config/nvim.nvim/init.luais still immutable since it's stored withreadFilein compile timeProposal
I propose to introduce two modes:
mutablemode: read nvim config directly from the./nvimdirectory of the flakeimmutablemode: read nvim config from nix store. This is just the same as it was withwrapRc=trueHere are two derivations using the new option:
Here is the code in mkNeovim.nix (https://github.com/shofel/dotfiles/blob/merge-nvim/neovim/mkNeovim.nix#L59)
Another change is how the derivation with config directory is prepared. I removed the machinery of splitting the config dir to
lua/,nvim/andafter/. I believe withinstallPhase = "cp -r . $out";we achieve the behaviour closest to neovim without nix. Right? 🤔Beta Was this translation helpful? Give feedback.
All reactions