robin/weave
simple neovim wrapper for nix
git clone https://git.robinwobin.dev/robin/weave
a86f32a
main
weave
Weave is a simple neovim wrapper for nix that allows you to maintain your neovim configuration with lua and with nix for package management.
Weave is meant be a very minimal neovim wrapper, but i can still be pretty opiniated at times.
Weave is based on gift-wrap
Usage
{ inputs = { nixpkgs . url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" ; weave = { url = "git+https://codeberg.org/comfysage/weave" ; inputs . nixpkgs . follows = "nixpkgs" ; }; }; outputs = { self , nixpkgs , weave } :let inherit ( nixpkgs ) lib ; forAllSystems = f :lib . genAttrs lib . systems . flakeExposed ( system :f nixpkgs . legacyPackages .${ system } ); in { packages = forAllSystems ( pkgs :{ nvim = weave . legacyPackages .${ pkgs . system }. wrapNeovim { # what is the name of your neovim config? pname = "my-neovim" ; # perhaps add a version suffix to your package # this is a sensible default versionSuffix = self . shortRev or self . dirtyShortRev or "unknown" ; # this is the base package for your neovim configuration # this defaults to neovim-unwrapped and most of the time you will not need to change this basePackage = pkgs . neovim-unwrapped ; # this field allows you to create aliases to the neovim executable # this defaults to blank, the bellow example will create the aliases `vi` and `vim` aliases = [ "vi" "vim" ]; # wether to keep the desktop files for neovim # by default this is set to false, but you can set it to true keepDesktopFiles = true ; # your user conifguration, this should be a path your nvim config in lua userConfig = ./config ; # use npins to manage your plugins plugins = import ./npins {}; # override npins sources pluginOverrides = { lynn = { passthru . start = true ; }; }; # all the plugins that should be stored in the neovim start directory # these are the plugins that are loaded when neovim starts startPlugins = with pkgs . vimPlugins ; [ nvim-treesitter . withAllGrammars nvim-lspconfig ]; # these are plugins that are loaded on demand by your configuration optPlugins = with pkgs . vimPlugins ; [ blink-cmp telescope lazygit-nvim ]; # these are any extra packages that should be available in your neovim environment extraPackages = with pkgs ; [ ripgrep fd inotify-tools lazygit ]; # below is a list of plugin providers, these should then be # configured in your plugin or setup properly by adding to your path # or the extraInitLua # # this can also be a list of strings providers = { node = false ; python = false ; python3 = true ; ruby = false ; perl = false ; }; # following the providers above, you can set the exact package for # your providers, in this case python3 extraInitLua = '' vim.g.python3_host_prog = ' ${ lib . getExe pkgs . python3 } ' '' ; }; }); }; }
1## weave 2 3Weave is a simple neovim wrapper for nix that allows you to maintain your 4neovim configuration with lua and with nix for package management. 5 6Weave is meant be a very minimal neovim wrapper, but i can still be pretty opiniated at times. 7 8Weave is based on [gift-wrap] 9 10[gift-wrap] :https://github.com/tgirlcloud/gift-wrap 11 12### Usage 13 14``` nix 15{ 16inputs = { 17nixpkgs . url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" ; 18 19weave = { 20url = "git+https://codeberg.org/comfysage/weave" ; 21inputs . nixpkgs . follows = "nixpkgs" ; 22}; 23}; 24 25outputs = { self , nixpkgs , weave }: 26let 27inherit ( nixpkgs ) lib ; 28 29forAllSystems = 30f : lib . genAttrs lib . systems . flakeExposed ( system : f nixpkgs . legacyPackages .${ system }); 31in 32{ 33packages = forAllSystems ( pkgs : { 34nvim = weave . legacyPackages .${ pkgs . system }. wrapNeovim { 35# what is the name of your neovim config? 36pname = "my-neovim" ; 37 38# perhaps add a version suffix to your package 39# this is a sensible default 40versionSuffix = self . shortRev or self . dirtyShortRev or "unknown" ; 41 42# this is the base package for your neovim configuration 43# this defaults to neovim-unwrapped and most of the time you will not need to change this 44basePackage = pkgs . neovim-unwrapped ; 45 46# this field allows you to create aliases to the neovim executable 47# this defaults to blank, the bellow example will create the aliases `vi` and `vim` 48aliases = [ "vi" "vim" ]; 49 50# wether to keep the desktop files for neovim 51# by default this is set to false, but you can set it to true 52keepDesktopFiles = true ; 53 54# your user conifguration, this should be a path your nvim config in lua 55userConfig = ./config ; 56 57# use npins to manage your plugins 58plugins = import ./npins {}; 59 60# override npins sources 61pluginOverrides = { 62lynn = { passthru . start = true ; }; 63}; 64 65# all the plugins that should be stored in the neovim start directory 66# these are the plugins that are loaded when neovim starts 67startPlugins = with pkgs . vimPlugins ; [ 68nvim-treesitter . withAllGrammars 69nvim-lspconfig 70]; 71 72# these are plugins that are loaded on demand by your configuration 73optPlugins = with pkgs . vimPlugins ; [ 74blink-cmp 75telescope 76lazygit-nvim 77]; 78 79# these are any extra packages that should be available in your neovim environment 80extraPackages = with pkgs ; [ 81ripgrep 82fd 83inotify-tools 84lazygit 85]; 86 87# below is a list of plugin providers, these should then be 88# configured in your plugin or setup properly by adding to your path 89# or the extraInitLua 90# 91# this can also be a list of strings 92providers = { 93node = false ; 94python = false ; 95python3 = true ; 96ruby = false ; 97perl = false ; 98}; 99 100# following the providers above, you can set the exact package for 101# your providers, in this case python3 102extraInitLua = '' 103vim.g.python3_host_prog = '${ lib . getExe pkgs . python3 }' 104''; 105}; 106}); 107}; 108} 109```