<Shados>
I've written a standalone module I can use from nixos or home-manager as a submodule, or use on its own with evalModules, for configuring neovim & plugins. One thing I can do with it is build a neovim config for a nix-shell expression by adding some extra configuration to existing neovim config defined in nixos and/or home-manager -- I can specialize from a general configuration. Right now I'm doing that by evaluating nixos/hm modules, pulling the
<Shados>
definitions for my submodule from `options.some.submodule.path.definitions` and then adding those as module items to my standalone evalModules usage. Which works, but I'm wondering if anyone has suggestions as to a simpler approach?
<{^_^}>
#55635 (by teto, 14 weeks ago, open): [wip] neovim: add standalone module to configure it
<Shados>
teto: Somewhat. I took some inspiration from your PR, but the module I've written is pretty specific to my needs. Mainly it uses a structured plugin-config type to associate plugin derivations with various bits of metadata (e.g. remote host requirements and remote-host-specifig language packages, Lua deps, binary deps 'soft' plugin dependencies, init.vim configuration fragments), then builds the neovim config and wrapper from an (implicit) list of required
<Shados>
plugins + the plugin config stuff. Also, my module imports my wrapper, rather than the other way around (although I'm guessing you have it done that way mainly to fit more normally within nixpkgs?).
<Shados>
Aside from that, I have some logic around inferring plugin sources from vim-plug-style shortnames, and a Nix/Python polyglot to conveniently prefetch and pin sources for these "source" plugins
<teto>
Shados: seems like some of the medata should rather leave in nixpkgs like deps and all. It would help to see the code, is it public ?
MichaelRaskin has quit [Quit: MichaelRaskin]
<teto>
s/leave/live
<Shados>
teto: Ideally *some* of it would, and some amount of that "some" already does :p. There are some issues. Firstly, it's not just that "plugin a has a dependency on derivation b", it's also things like "plugin a with configuration c has a dependency on derivations b and d" -- the configuration of vim plugins can effectively give them extra dependencies. e.g. configuring ALE to use perlcritic means that the ALE derivation effectively has a dependency on the
<Shados>
perlcritic derivation.
<Shados>
So I wanted a way for the user (me) to tie together per-plugin dependencies and per-plugin configuration.
<Shados>
It's not on github or anything yet, probably will be in the next day or two, I'll poke you when it is. Want to get it to the point where I'm actively using it on my main systems before I upload it... it's already been through roughly four interface changes in the past week and a half.
<Shados>
Another issue is that there are ordering relations among vim plugins other than just "a depends on b", e.g. vim-devicons has to be loaded after a number of other plugins (if they happen to be used) in order to work properly with them, but it doesn't actually require that those plugins be loaded in order to work. It would be nice to have this information in nixpkgs, but right now it would mean that each of those plugins would also have to exist in nixpkgs...
<Shados>
it could instead be done by just listing the names of the soft deps rather than the derivations, but nixpkgs.vimPlugins isn't very consistent about plugin names. It should *probably* just use "reponame" for git-sourced plugins, and whatever vim-pi has for vim.org scripts, but right now it does not.
<arianvp>
and was wondering if we can deprecate the `system` option? as it seems to be fully replaced by `localSystem` now
<arianvp>
nixos/lib/eval-config.nix hardcodes nixpkgs.system = builtins.currentSystem but it seems it could lib.mkDefault localSystem instead with no trouble right?
<arianvp>
as in, make it set localSystem instead of system
<arianvp>
the whole system thing is kinda confusing, and hardcoded to builtins.currentSystem in mutliple places
<arianvp>
in nixos/default.nix in nixos/lib/eval-config.nix and another time in nixos/modules/misc/nixpkgs.nix
<arianvp>
but would be nice to hear from someone who is a bit familiar with this before I start refactoring it all away for no good reason
<gchristensen>
given I have a file, /home/grahamc/lol.drv -- can I add this to the store as a drv, as if I had nix-instantiated it?
<gchristensen>
hrm. I should have just tried it :P
<tilpner>
"error: derivation '/nix/store/wxl6v5wyvhyg4y2q6w4811w2sx26cqci-hello-2.10.drv' has incorrect output '/nix/store/g7z76d43d2a9zkrzm6yc4hf95ngcj5dl-hello-2.10', should be '/nix/store/g7z76d43d2a9zkrzm6yc4hf95ngcj5dl-hello-2.10'"
<tilpner>
gchristensen: Did you get it to work?
<tilpner>
I don't need it, but was curious, and now it's complaining that the output path is correct
<gchristensen>
I thought I did, but not sure
<gchristensen>
tilpner: I bet `nix copy` can do it