feat(nvim): use custom flake for hypr treesitter
This commit is contained in:
parent
9dd57f8a54
commit
1f6c5f875f
3 changed files with 159 additions and 130 deletions
|
@ -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,25 +128,7 @@ 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
|
|
||||||
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; [
|
|
||||||
# Coc configured
|
# Coc configured
|
||||||
coc-css
|
coc-css
|
||||||
coc-eslint
|
coc-eslint
|
||||||
|
@ -211,13 +187,7 @@ in {
|
||||||
}
|
}
|
||||||
nvim-treesitter-context
|
nvim-treesitter-context
|
||||||
nvim-treesitter-textobjects
|
nvim-treesitter-textobjects
|
||||||
{
|
nvim-treesitter-hypr
|
||||||
plugin = tree-sitter-hypr;
|
|
||||||
type = "lua";
|
|
||||||
config = ''
|
|
||||||
vim.treesitter.language.require_language("hypr", "${hypr-grammar}/parser")
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
plugin = nvim-treesitter.withAllGrammars;
|
plugin = nvim-treesitter.withAllGrammars;
|
||||||
type = "viml";
|
type = "viml";
|
||||||
|
|
87
flake.lock
87
flake.lock
|
@ -207,6 +207,24 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils_3": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_4"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1694529238,
|
||||||
|
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"hercules-ci-effects": {
|
"hercules-ci-effects": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
|
@ -280,11 +298,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1700941474,
|
"lastModified": 1700967537,
|
||||||
"narHash": "sha256-1qI7ZMBvbVPofz8jWqNlhBgol03huMWFduSwXb/UVMY=",
|
"narHash": "sha256-TzyP5xNGF+rCj2ko+E+VOpQTtzlQ4TfDLuObEPbRX6g=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "ad3f6886484e9adbab532de125e69a70c54fa13e",
|
"rev": "cd96ceecc551c25631783499bd92c6662c5d3616",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -447,11 +465,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1700874698,
|
"lastModified": 1700961605,
|
||||||
"narHash": "sha256-45bXCKIc3BZA3q83vAJi2qcd0mdkWp4bG/AmbBx01TA=",
|
"narHash": "sha256-nN5m0OhqmD0gxtpXDvXyqCPQux9L/o1Yr1ALKoaOT9o=",
|
||||||
"owner": "fufexan",
|
"owner": "fufexan",
|
||||||
"repo": "nix-gaming",
|
"repo": "nix-gaming",
|
||||||
"rev": "9ed5f7f0e6f14fb8956ddb8c0ed345d6b4aee2c0",
|
"rev": "076d7864a6c2d02e41325c03ad3200a8a3739763",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -489,11 +507,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1700363379,
|
"lastModified": 1700968077,
|
||||||
"narHash": "sha256-fBEVPFwSZ6AmBE1s1oT7E9WVuqRghruxTnSQ8UUlMkw=",
|
"narHash": "sha256-Lax+2g7G3Fe+ckMrHLYTl+97unbmNDmN1qS9MLBkxr4=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "27920146e671a0d565aaa7452907383be14d8d82",
|
"rev": "bd3aec0ecb0fdde863a7ed2c6caa220c47e22c07",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -610,11 +628,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1700108881,
|
"lastModified": 1700856099,
|
||||||
"narHash": "sha256-+Lqybl8kj0+nD/IlAWPPG/RDTa47gff9nbei0u7BntE=",
|
"narHash": "sha256-RnEA7iJ36Ay9jI0WwP+/y4zjEhmeN6Cjs9VOFBH7eVQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7414e9ee0b3e9903c24d3379f577a417f0aae5f1",
|
"rev": "0bd59c54ef06bc34eca01e37d689f5e46b3fe2f1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -706,11 +724,11 @@
|
||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1700955854,
|
"lastModified": 1700973070,
|
||||||
"narHash": "sha256-dRl/Q8CehO/W+YF06rurH5oxt75Jc9TrUmtIc8eCC2c=",
|
"narHash": "sha256-xYun1OP1lmhi94JzFXajEKj0ipO6cmKVpVZXZP3lSH0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "6d06cec40da7895c8e5278be921c785ffcb6e2ea",
|
"rev": "9a5c43cffc04beb342e4f0299b5b31c87db39b38",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -752,7 +770,8 @@
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"nixpkgs-wayland": "nixpkgs-wayland",
|
"nixpkgs-wayland": "nixpkgs-wayland",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"nurl": "nurl"
|
"nurl": "nurl",
|
||||||
|
"tree-sitter-hypr": "tree-sitter-hypr"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
@ -800,6 +819,42 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tree-sitter-hypr": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_3",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1700973902,
|
||||||
|
"narHash": "sha256-Zp/I8/ZUXEl9KkVMdOvAJhiIgDRYK0vFzi0JBtzbHYg=",
|
||||||
|
"owner": "matt1432",
|
||||||
|
"repo": "tree-sitter-hypr",
|
||||||
|
"rev": "abbdfe0418f898a8a7f289c97e6ed15f1b9dfae8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "matt1432",
|
||||||
|
"repo": "tree-sitter-hypr",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
|
@ -35,6 +35,10 @@
|
||||||
url = "github:matt1432/coc-stylelintplus";
|
url = "github:matt1432/coc-stylelintplus";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
tree-sitter-hypr = {
|
||||||
|
url = "github:matt1432/tree-sitter-hypr";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
nh.url = "github:viperML/nh";
|
nh.url = "github:viperML/nh";
|
||||||
nix-melt.url = "github:nix-community/nix-melt";
|
nix-melt.url = "github:nix-community/nix-melt";
|
||||||
|
|
Loading…
Reference in a new issue