diff --git a/flake.lock b/flake.lock index daceed4..95bba5d 100644 --- a/flake.lock +++ b/flake.lock @@ -357,6 +357,22 @@ "type": "github" } }, + "nvim-treesitter": { + "flake": false, + "locked": { + "lastModified": 1637761627, + "narHash": "sha256-E8/CY1JjalIlyzI2Is2ZrhD1DXCfuX4u81qj+7CXYTg=", + "owner": "nvim-treesitter", + "repo": "nvim-treesitter", + "rev": "8016b74cea415596be405b14067d2938914b2e18", + "type": "github" + }, + "original": { + "owner": "nvim-treesitter", + "repo": "nvim-treesitter", + "type": "github" + } + }, "oglfPatches": { "flake": false, "locked": { @@ -508,6 +524,7 @@ "nix-gaming": "nix-gaming", "nixpkgs": "nixpkgs_2", "no-double-back-pc": "no-double-back-pc", + "nvim-treesitter": "nvim-treesitter", "packwiz": "packwiz", "powercord-overlay": "powercord-overlay", "powercord-popout-fix": "powercord-popout-fix", diff --git a/flake.nix b/flake.nix index 4b8967c..1cf13de 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,7 @@ discord-tokyonight = { url = "github:DanisDGK/zelk-customizations"; flake = false; }; discover = { url = "github:trigg/Discover"; flake = false; }; linux-tkg = { url = "github:Frogging-Family/linux-tkg"; flake = false; }; + nvim-treesitter = { url = "github:nvim-treesitter/nvim-treesitter"; flake = false; }; packwiz = { url = "github:comp500/packwiz"; flake = false; }; spotify-adblock = { url = "github:abba23/spotify-adblock"; flake = false; }; tree-sitter-glimmer = { url = "github:alexlafroscia/tree-sitter-glimmer"; flake = false; }; diff --git a/modules/user/neovim.nix b/modules/user/neovim.nix index 089898c..7082f34 100644 --- a/modules/user/neovim.nix +++ b/modules/user/neovim.nix @@ -42,7 +42,7 @@ in { cmp_luasnip luasnip - (nvim-treesitter.withPlugins (p: with p; [ + (pkgs.me.nvim-treesitter-nightly.withPlugins (p: with p; [ tree-sitter-comment tree-sitter-c-sharp pkgs.me.tree-sitter-glimmer diff --git a/packages/default.nix b/packages/default.nix index 1d6b41d..20d7831 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -5,6 +5,7 @@ discord-tokyonight = callPackage ./discord-tokyonight { inherit inputs; }; discover-overlay = callPackage ./discover { inherit inputs; }; linux-lava = callPackage ./linux-lava { inherit inputs; }; + nvim-treesitter-nightly = callPackage ./nvim-treesitter-nightly { inherit inputs; }; packwiz = callPackage ./packwiz { inherit inputs; }; spotify-adblock = callPackage ./spotify-adblock { inherit inputs; }; tree-sitter-glimmer = callPackage ./tree-sitter-glimmer { inherit inputs; }; diff --git a/packages/nvim-treesitter-nightly/default.nix b/packages/nvim-treesitter-nightly/default.nix new file mode 100644 index 0000000..eb61436 --- /dev/null +++ b/packages/nvim-treesitter-nightly/default.nix @@ -0,0 +1,26 @@ +{ + inputs, + tree-sitter, + vimPlugins +}: +let + nvim-treesitter-nightly = vimPlugins.nvim-treesitter.overrideAttrs(_: { + pname = "nvim-treesitter-nightly"; + version = inputs.nvim-treesitter.lastModifiedDate; + src = inputs.nvim-treesitter; + }); +in nvim-treesitter-nightly.overrideAttrs(o: { + passthru = o.passthru // { + unwrapped = nvim-treesitter-nightly; + withPlugins = grammarFn: nvim-treesitter-nightly.overrideAttrs (_: { + postPatch = + let + grammars = tree-sitter.withPlugins grammarFn; + in + '' + rm -r parser + ln -s ${grammars} parser + ''; + }); + }; +})