diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..ae5e54f --- /dev/null +++ b/default.nix @@ -0,0 +1,39 @@ +{ wrapNeovim, neovim-unwrapped, vimPlugins, ... }: + +wrapNeovim neovim-unwrapped { + withPython3 = false; + withNodeJs = false; + withRuby = false; + + configure = { + customRC = '' + lua << EOF + require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" + ensure_installed = {}, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + highlight = { + enable = true, + }, + + indent = { + enable = true, + }, + }) + EOF + ''; + + packages.myVimPackages = + { + start = with vimPlugins; [ + (nvim-treesitter.withPlugins + (ts: [ + ts.tree-sitter-nix + ])) + ]; + }; + }; +} diff --git a/flake.nix b/flake.nix index d14b651..f074dca 100644 --- a/flake.nix +++ b/flake.nix @@ -9,44 +9,7 @@ let pkgs = import nixpkgs { inherit system; }; - neovim = pkgs.wrapNeovim pkgs.neovim-unwrapped - { - withPython3 = false; - withNodeJs = false; - withRuby = false; - - configure = { - customRC = '' - lua << EOF - require("nvim-treesitter.configs").setup({ - -- A list of parser names, or "all" - ensure_installed = {}, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - highlight = { - enable = true, - }, - - indent = { - enable = true, - }, - }) - EOF - ''; - - packages.myVimPackages = - { - start = with pkgs.vimPlugins; [ - (nvim-treesitter.withPlugins - (ts: [ - ts.tree-sitter-nix - ])) - ]; - }; - }; - }; + neovim = pkgs.callPackage ./. { }; in { devShells.default = pkgs.mkShell {