diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2022-11-28 16:22:11 +0100 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2022-11-28 16:22:11 +0100 |
| commit | 9c198c6dbc818710c5206fd812a25510e43e221a (patch) | |
| tree | 9934426f2ab37985b7fb5e7c2068c47e361c96df | |
| parent | 7b5eab661775f031510831176a6994d541ded669 (diff) | |
add new tree-sitter for just file
| -rw-r--r-- | flake.lock | 24 | ||||
| -rw-r--r-- | flake.nix | 71 | ||||
| -rw-r--r-- | neovim/init.fnl | 3 | ||||
| -rw-r--r-- | neovim/init.lua | 41 | ||||
| -rw-r--r-- | overlays/treesitter.nix | 23 | ||||
| -rw-r--r-- | overlays/vimPlugins.nix | 42 |
6 files changed, 83 insertions, 121 deletions
@@ -8,11 +8,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1668788863, - "narHash": "sha256-FsdUG+YkRX7JZKZm6T44J2h+0pXB1sWA9AobyiozFK0=", + "lastModified": 1669573161, + "narHash": "sha256-UAOXq+LIX+goAAY2MiC0+zCxdNPaO7NAPTvCQExpIBs=", "owner": "nix-community", "repo": "home-manager", - "rev": "948d1f8a5cef55a281d4f5d17f3b79df6c82fce1", + "rev": "50c9bccb6abc52811a59db620606e016fcde32bd", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "mvinkio": { "locked": { - "lastModified": 1668543748, - "narHash": "sha256-S/PEXbIgJ+vCe1Nlq19CL6gmS92wMZvNRUJC/Q7tBJA=", + "lastModified": 1669579238, + "narHash": "sha256-Kk48N1r48jAj6iiCiXgwcv9cXasTDY8hgrsRaPrXicw=", "owner": "mvinkio", "repo": "nixpkgs", - "rev": "015ec7f85bb9a8278600d0a05eab9328f2c899ea", + "rev": "007f4f91390d742aff1e605d057283e486f12a3b", "type": "github" }, "original": { @@ -39,11 +39,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1668765800, - "narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=", + "lastModified": 1669411043, + "narHash": "sha256-LfPd3+EY+jaIHTRIEOUtHXuanxm59YKgUacmSzaqMLc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739", + "rev": "5dc7114b7b256d217fe7752f1614be2514e61bb8", "type": "github" }, "original": { @@ -55,11 +55,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1668766498, - "narHash": "sha256-UjZlIrbHGlL3H3HZNPTxPSwJfr49jIfbPWCYxk0EQm4=", + "lastModified": 1669418739, + "narHash": "sha256-T86oFvcUIRwHWBWUt7WjaP4BP/3lDGbv5AppQSI1FkI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f42a45c015f28ac3beeb0df360e50cdbf495d44b", + "rev": "695b3515251873e0a7e2021add4bba643c56cde3", "type": "github" }, "original": { @@ -1,5 +1,5 @@ { - description = "Home Manager configuration of Jane Doe"; + description = "Home Manager configuration"; # Specify the source of Home Manager and Nixpkgs and vim plugins. inputs = { @@ -22,69 +22,10 @@ }: let system = "x86_64-linux"; mvinkioPkgs = mvinkio.legacyPackages.${system}; - overlay = nixpkgs.lib.composeManyExtensions [ - # (final: prev: { - # tree-sitter = mvinkioPkgs.tree-sitter; - # vimPlugins = - # prev.vimPlugins - # // { - # nvim-treesitter = mvinkioPkgs.vimPlugins.nvim-treesitter.overrideAttrs (old: { - # version = "2022-10-28"; - # src = builtins.fetchGit { - # url = "file:///home/mike/projects/nvim-treesitter"; - # rev = "2c0ae6e8e81366ba088f1e5be62f467212cda52e"; - # }; - # passthru.withPlugins = grammarFn: - # final.vimPlugins.nvim-treesitter.overrideAttrs (_: { - # postPatch = let - # grammars = mvinkioPkgs.tree-sitter.withPlugins grammarFn; - # in '' - # rm -r parser - # ln -s ${grammars} parser - # ''; - # }); - # }); - # }; - # }) - # overlay some vim plugins - (final: prev: { - vimPlugins = let - getVimPlugin = { - name, - git, - rev, - ref ? "master", - }: - pkgs.vimUtils.buildVimPluginFrom2Nix { - inherit name; - src = builtins.fetchGit { - url = "https://github.com/${git}"; - submodules = true; - inherit rev; - inherit ref; - }; - }; - in - prev.vimPlugins - // { - neotest-python = getVimPlugin { - name = "neotest-python"; - git = "nvim-neotest/neotest-python"; - rev = "e53920d145d37783c8d8428365a0a230e0a18cb5"; - }; - firvish-nvim = getVimPlugin { - name = "firvish-nvim"; - git = "Furkanzmc/firvish.nvim"; - rev = "127f9146175d6bbaff6a8b761081cfd2279f8351"; - }; - nvim-parinfer = getVimPlugin { - name = "nvim-parinfer"; - git = "gpanders/nvim-parinfer"; - rev = "82bce5798993f4fe5ced20e74003b492490b4fe8"; - }; - }; - }) + overlay = nixpkgs.lib.composeManyExtensions [ + (import ./overlays/treesitter.nix {inherit mvinkioPkgs;}) + (import ./overlays/vimPlugins.nix {inherit pkgs;}) ]; pkgs = import nixpkgs { @@ -96,14 +37,10 @@ in { homeConfigurations.mike = home-manager.lib.homeManagerConfiguration { inherit pkgs; - # Specify your home configuration modules here, for example, - # the path to your home.nix. modules = [ ./home.nix ]; - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix extraSpecialArgs = { flake = self; home-manager = home-manager; diff --git a/neovim/init.fnl b/neovim/init.fnl index 878dff3..f4a3373 100644 --- a/neovim/init.fnl +++ b/neovim/init.fnl @@ -4,7 +4,8 @@ allowed-globals (icollect [n _ (pairs _G)] n) opts {:verbosity 0 :compiler {:modules {:allowedGlobals allowed-globals}}}] - (build "/home/mike/dotnix/neovim/init.fnl" opts ".+" #(values $1)))) + (build "/home/mike/dotnix/neovim/init.fnl" opts ".+" #(values $1)) + (build))) ;; Call hotpot.setup and compile again after fs event (let [hotpot (require :hotpot) diff --git a/neovim/init.lua b/neovim/init.lua deleted file mode 100644 index 36ad398..0000000 --- a/neovim/init.lua +++ /dev/null @@ -1,41 +0,0 @@ -local function build_init() - local _let_1_ = require("hotpot.api.make") - local build = _let_1_["build"] - local allowed_globals - do - local tbl_17_auto = {} - local i_18_auto = #tbl_17_auto - for n, _ in pairs(_G) do - local val_19_auto = n - if (nil ~= val_19_auto) then - i_18_auto = (i_18_auto + 1) - do end (tbl_17_auto)[i_18_auto] = val_19_auto - else - end - end - allowed_globals = tbl_17_auto - end - local opts = {verbosity = 0, compiler = {modules = {allowedGlobals = allowed_globals}}} - local function _3_(_241) - return _241 - end - return build("/home/mike/dotnix/neovim/init.fnl", opts, ".+", _3_) -end -do - local hotpot = require("hotpot") - local setup = hotpot.setup - local build = hotpot.api.make.build - local uv = vim.loop - setup({provide_require_fennel = true, compiler = {modules = {correlate = true}, macros = {env = "_COMPILER", compilerEnv = _G, allowedGlobals = false}}}) - local handle = uv.new_fs_event() - local path = vim.fn.expand("/home/mike/dotnix/neovim/init.fnl") - local function _4_() - return vim.schedule(build_init) - end - uv.fs_event_start(handle, path, {}, _4_) - local function _5_() - return uv.close(handle) - end - vim.api.nvim_create_autocmd("VimLeavePre", {callback = _5_}) -end -return require("conf")
\ No newline at end of file diff --git a/overlays/treesitter.nix b/overlays/treesitter.nix new file mode 100644 index 0000000..6d6cabb --- /dev/null +++ b/overlays/treesitter.nix @@ -0,0 +1,23 @@ +{mvinkioPkgs, ...}: (final: prev: { + tree-sitter = mvinkioPkgs.tree-sitter; + vimPlugins = + prev.vimPlugins + // { + nvim-treesitter = mvinkioPkgs.vimPlugins.nvim-treesitter.overrideAttrs (old: { + version = "2022-10-28"; + src = builtins.fetchGit { + url = "file:///home/mike/projects/nvim-treesitter"; + rev = "2c0ae6e8e81366ba088f1e5be62f467212cda52e"; + }; + passthru.withPlugins = grammarFn: + final.vimPlugins.nvim-treesitter.overrideAttrs (_: { + postPatch = let + grammars = mvinkioPkgs.tree-sitter.withPlugins grammarFn; + in '' + rm -r parser + ln -s ${grammars} parser + ''; + }); + }); + }; +}) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix new file mode 100644 index 0000000..0d2b780 --- /dev/null +++ b/overlays/vimPlugins.nix @@ -0,0 +1,42 @@ +{pkgs, ...}: (final: prev: { + vimPlugins = let + getVimPlugin = { + name, + git, + rev, + ref ? "master", + }: + pkgs.vimUtils.buildVimPluginFrom2Nix { + inherit name; + src = builtins.fetchGit { + url = "https://github.com/${git}"; + submodules = true; + inherit rev; + inherit ref; + }; + }; + in + prev.vimPlugins + // { + neotest-python = getVimPlugin { + name = "neotest-python"; + git = "nvim-neotest/neotest-python"; + rev = "e53920d145d37783c8d8428365a0a230e0a18cb5"; + }; + firvish-nvim = getVimPlugin { + name = "firvish-nvim"; + git = "Furkanzmc/firvish.nvim"; + rev = "127f9146175d6bbaff6a8b761081cfd2279f8351"; + }; + nvim-parinfer = getVimPlugin { + name = "nvim-parinfer"; + git = "gpanders/nvim-parinfer"; + rev = "82bce5798993f4fe5ced20e74003b492490b4fe8"; + }; + vim-just = getVimPlugin { + name = "vim-just"; + git = "NoahTheDuke/vim-just"; + rev = "838c9096d4c5d64d1000a6442a358746324c2123"; + }; + }; +}) |
