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,
lib,
tree-sitter-hypr,
...
}: 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;
nvim-treesitter-hypr = tree-sitter-hypr.packages.${pkgs.system}.default;
in {
# TODO: make a gradle module and have java in device-vars.nix
xdg.dataFile = {
@ -134,25 +128,7 @@ in {
extraConfig = fileContents ./base.vim;
extraLuaConfig = fileContents ./base.lua;
plugins = let
# custom packages
hypr-src = pkgs.fetchFromGitHub {
owner = "luckasRanarison";
repo = "tree-sitter-hypr";
rev = "90b3ddf8a85b5ea3d9dc4920fddb16182a192e14";
hash = "sha256-ErFs2eCC0eZEyDldrTUj4JJ0Eu+exDHNQx4g8WXh/UQ=";
};
tree-sitter-hypr = plugin hypr-src;
hypr-grammar = pkgs.tree-sitter.buildGrammar {
language = "hypr";
src = hypr-src;
version = hypr-src.rev;
generate = true;
};
in
with pkgs.vimPlugins; [
plugins = with pkgs.vimPlugins; [
# Coc configured
coc-css
coc-eslint
@ -211,13 +187,7 @@ in {
}
nvim-treesitter-context
nvim-treesitter-textobjects
{
plugin = tree-sitter-hypr;
type = "lua";
config = ''
vim.treesitter.language.require_language("hypr", "${hypr-grammar}/parser")
'';
}
nvim-treesitter-hypr
{
plugin = nvim-treesitter.withAllGrammars;
type = "viml";

Binary file not shown.

BIN
flake.nix

Binary file not shown.