From 92d69d0f50f0e10180c0b2e213259a123db4d316 Mon Sep 17 00:00:00 2001 From: pistachiology Date: Sat, 21 May 2022 01:17:13 +0700 Subject: [PATCH] Temporary fixes nix tree-sitter while waiting for unstable release issue: github.com/NixOS/nixpkgs/pull/173522 --- nixpkgs/flake.lock | 18 +++++++++--------- nixpkgs/modules/neovim.nix | 19 ++++++++++++++----- nixpkgs/modules/tree-sitter-nix.json | 11 +++++++++++ 3 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 nixpkgs/modules/tree-sitter-nix.json diff --git a/nixpkgs/flake.lock b/nixpkgs/flake.lock index 2f0f74d..5fec739 100644 --- a/nixpkgs/flake.lock +++ b/nixpkgs/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1652452043, - "narHash": "sha256-nh3mdVB/Kk5ag1uRMAlKo8r+ssN3HNxwbLsqRG4xZkw=", + "lastModified": 1652996682, + "narHash": "sha256-7ZWyd5W2tM/uxXGn16AJUXenlGPUt/r6zitEcorz5j0=", "owner": "nix-community", "repo": "home-manager", - "rev": "273598f53e04f0111dca5724b37640e3907edaaf", + "rev": "02b15de8ad714409358cffdc6ed518ade03402c4", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1652467128, - "narHash": "sha256-1wuQ7QgPQ3tugYcoVMJ3pUzl4wVdBzKZr9qtJAgA4VI=", + "lastModified": 1652885393, + "narHash": "sha256-YIgvvlk4iQ1Hi7KD9o5gsojc+ApB+jiH1d5stK8uXiw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fb222e008681fce4608e94f2d1dfdf3d03a364c4", + "rev": "48037fd90426e44e4bf03e6479e88a11453b9b66", "type": "github" }, "original": { @@ -80,11 +80,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1652582519, - "narHash": "sha256-7pjmBoFzaoKn/oLD6sMBNVy0HCvRyAdUA5nZ68v5pw8=", + "lastModified": 1653014441, + "narHash": "sha256-6TRk5POjjevXZUzBnQ7Nlac1It4l12mEAltw5sRfQg8=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "8cb3e0b16287177c909e01ccb3e2485ec9c01f87", + "rev": "6ae180c1af192475b29e269f10d9da2d5abec4f0", "type": "github" }, "original": { diff --git a/nixpkgs/modules/neovim.nix b/nixpkgs/modules/neovim.nix index 9c39935..ec2635a 100644 --- a/nixpkgs/modules/neovim.nix +++ b/nixpkgs/modules/neovim.nix @@ -1,4 +1,12 @@ { config, pkgs, libs, lib, ... }: +let + tree-sitter = pkgs.tree-sitter.override { + extraGrammars = { + tree-sitter-nix = lib.importJSON ./tree-sitter-nix.json; + }; + }; + grammars = tree-sitter.allGrammars; +in { programs.neovim = { enable = true; @@ -24,7 +32,7 @@ ''; plugins = with pkgs.vimPlugins; [ - (nvim-treesitter.withPlugins (p: pkgs.tree-sitter.allGrammars)) + (nvim-treesitter.withPlugins (p: grammars)) markdown-preview-nvim lightspeed-nvim vim-prisma @@ -33,10 +41,11 @@ }; - xdg.configFile."nvim/fnl" = { - source = ../config/nvim/fnl; - recursive = true; - }; + xdg.configFile."nvim/fnl" = + { + source = ../config/nvim/fnl; + recursive = true; + }; xdg.configFile."nvim/boot.lua" = { source = ../config/nvim/init.lua; diff --git a/nixpkgs/modules/tree-sitter-nix.json b/nixpkgs/modules/tree-sitter-nix.json new file mode 100644 index 0000000..8016342 --- /dev/null +++ b/nixpkgs/modules/tree-sitter-nix.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/cstrahan/tree-sitter-nix", + "rev": "6d6aaa50793b8265b6a8b6628577a0083d3b923d", + "date": "2021-11-29T00:27:21-06:00", + "path": "/nix/store/6cjadxvqbrh205lsqnk2rnzq3badxdxv-tree-sitter-nix", + "sha256": "0cbk6dqppasrvnm87pwfgm718z6b0xmy9m7zj8ysil0h8bklz1w9", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +}