feat(nvim): use custom flake for hypr treesitter

This commit is contained in:
matt1432 2023-11-25 23:55:08 -05:00
parent 9dd57f8a54
commit 1f6c5f875f
3 changed files with 84 additions and 114 deletions

View file

@ -1,17 +1,11 @@
{ {
pkgs, pkgs,
lib, lib,
tree-sitter-hypr,
... ...
}: let }: let
# installs a vim plugin from git with a given tag / branch
plugin = src:
pkgs.vimUtils.buildVimPlugin {
pname = "${lib.strings.sanitizeDerivationName src.repo}";
version = src.rev;
inherit src;
};
fileContents = lib.strings.fileContents; fileContents = lib.strings.fileContents;
nvim-treesitter-hypr = tree-sitter-hypr.packages.${pkgs.system}.default;
in { in {
# TODO: make a gradle module and have java in device-vars.nix # TODO: make a gradle module and have java in device-vars.nix
xdg.dataFile = { xdg.dataFile = {
@ -134,117 +128,93 @@ in {
extraConfig = fileContents ./base.vim; extraConfig = fileContents ./base.vim;
extraLuaConfig = fileContents ./base.lua; extraLuaConfig = fileContents ./base.lua;
plugins = let plugins = with pkgs.vimPlugins; [
# custom packages # Coc configured
hypr-src = pkgs.fetchFromGitHub { coc-css
owner = "luckasRanarison"; coc-eslint
repo = "tree-sitter-hypr"; coc-java
rev = "90b3ddf8a85b5ea3d9dc4920fddb16182a192e14"; coc-sh
hash = "sha256-ErFs2eCC0eZEyDldrTUj4JJ0Eu+exDHNQx4g8WXh/UQ="; coc-stylelintplus
}; {
plugin = coc-snippets;
type = "viml";
config = fileContents ./plugins/snippets.vim;
}
tree-sitter-hypr = plugin hypr-src; ## Lua
coc-sumneko-lua
neodev-nvim
hypr-grammar = pkgs.tree-sitter.buildGrammar { ## Fzf
language = "hypr"; coc-fzf
src = hypr-src; fzfWrapper
version = hypr-src.rev; fzf-vim
generate = true;
};
in
with pkgs.vimPlugins; [
# Coc configured
coc-css
coc-eslint
coc-java
coc-sh
coc-stylelintplus
{
plugin = coc-snippets;
type = "viml";
config = fileContents ./plugins/snippets.vim;
}
## Lua coc-highlight
coc-sumneko-lua coc-json
neodev-nvim coc-pyright
coc-vimlsp
coc-yaml
coc-toml
coc-markdownlint
coc-tsserver
fugitive
## Fzf {
coc-fzf plugin = dracula-nvim;
fzfWrapper type = "viml";
fzf-vim config = fileContents ./plugins/dracula.vim;
}
{
plugin = lualine-nvim;
type = "lua";
config = fileContents ./plugins/lualine.lua;
}
{
plugin = todo-comments-nvim;
type = "lua";
config = "require('todo-comments').setup()";
}
{
plugin = gitsigns-nvim;
type = "lua";
config = fileContents ./plugins/gitsigns.lua;
}
{
plugin = nvim-autopairs;
type = "lua";
config = fileContents ./plugins/autopairs.lua;
}
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-treesitter-hypr
{
plugin = nvim-treesitter.withAllGrammars;
type = "viml";
config = fileContents ./plugins/treesitter.vim;
}
{
plugin = indent-blankline-nvim;
type = "lua";
config = fileContents ./plugins/indent.lua;
}
{
plugin = mini-nvim;
type = "lua";
config = fileContents ./plugins/mini.lua;
}
{
plugin = neo-tree-nvim;
type = "viml";
config = ''
${fileContents ./plugins/neotree.vim}
coc-highlight lua << EOF
coc-json ${fileContents ./plugins/neotree.lua}
coc-pyright EOF
coc-vimlsp '';
coc-yaml }
coc-toml ];
coc-markdownlint
coc-tsserver
fugitive
{
plugin = dracula-nvim;
type = "viml";
config = fileContents ./plugins/dracula.vim;
}
{
plugin = lualine-nvim;
type = "lua";
config = fileContents ./plugins/lualine.lua;
}
{
plugin = todo-comments-nvim;
type = "lua";
config = "require('todo-comments').setup()";
}
{
plugin = gitsigns-nvim;
type = "lua";
config = fileContents ./plugins/gitsigns.lua;
}
{
plugin = nvim-autopairs;
type = "lua";
config = fileContents ./plugins/autopairs.lua;
}
nvim-treesitter-context
nvim-treesitter-textobjects
{
plugin = tree-sitter-hypr;
type = "lua";
config = ''
vim.treesitter.language.require_language("hypr", "${hypr-grammar}/parser")
'';
}
{
plugin = nvim-treesitter.withAllGrammars;
type = "viml";
config = fileContents ./plugins/treesitter.vim;
}
{
plugin = indent-blankline-nvim;
type = "lua";
config = fileContents ./plugins/indent.lua;
}
{
plugin = mini-nvim;
type = "lua";
config = fileContents ./plugins/mini.lua;
}
{
plugin = neo-tree-nvim;
type = "viml";
config = ''
${fileContents ./plugins/neotree.vim}
lua << EOF
${fileContents ./plugins/neotree.lua}
EOF
'';
}
];
}; };
}; };
} }

Binary file not shown.

BIN
flake.nix

Binary file not shown.