diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2022-10-30 14:38:35 +0100 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2022-10-30 14:38:35 +0100 |
| commit | 879650c4a49330425e0aad1bb79969dc0e11399b (patch) | |
| tree | fb121740d4f322c72958b29c124edc49131d2937 | |
| parent | 18a37da86840c9e111172f5f24ceebe227ca56ed (diff) | |
update
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | flake.lock | 19 | ||||
| -rw-r--r-- | flake.nix | 44 | ||||
| -rw-r--r-- | home.nix | 11 | ||||
| -rw-r--r-- | neovim/init.lua | 1 | ||||
| -rw-r--r-- | neovim/lua/vimrc.lua | 7 |
6 files changed, 73 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..826ecc4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/Session.vim @@ -37,10 +37,27 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1666961615, + "narHash": "sha256-+Sqz6zQA85Q14U/KwsJO386oxd47zDte8dqBGOtRJGg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "040c6d8374d090f46ab0e99f1f7c27a4529ecffd", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" } }, "utils": { @@ -1,23 +1,54 @@ { description = "Home Manager configuration of Jane Doe"; - # Specify the source of Home Manager and Nixpkgs. + # Specify the source of Home Manager and Nixpkgs and vim plugins. inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.05"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { nixpkgs, home-manager, ... }: + outputs = { self, nixpkgs, nixpkgs-stable, home-manager, ... }: let system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; + overlay = nixpkgs.lib.composeManyExtensions [ + (final: prev: { + vimPlugins = prev.vimPlugins // { + nvim-treesitter = prev.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 = prev.tree-sitter.withPlugins grammarFn; + in + '' + rm -r parser + ln -s ${grammars} parser + ''; + }); + }); + }; + }) + ]; + + pkgs = import nixpkgs { + overlays = [ + overlay + ]; + inherit system; + }; in { - homeConfigurations.mike = home-manager.lib.homeManagerConfiguration { - inherit pkgs; + homeConfigurations.mike = home-manager.lib.homeManagerConfiguration { + pkgs = pkgs; # Specify your home configuration modules here, for example, # the path to your home.nix. modules = [ @@ -26,6 +57,9 @@ # Optionally use extraSpecialArgs # to pass through arguments to home.nix + extraSpecialArgs = { + flake = self; + }; }; }; } @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ flake, config, pkgs, ... }: { # Found this here: nix-community.github.io configuration example @@ -70,7 +70,10 @@ viAlias = true; vimAlias = true; extraConfig = " - luafile neovim/init.lua +lua <<LUA +vim.opt.runtimepath:append({ [[${flake}/neovim]], [[${flake}/neovim/lua]] }) +vim.cmd [[luafile ${flake}/neovim/init.lua]] +LUA "; plugins = with pkgs.vimPlugins; let @@ -95,8 +98,10 @@ nlua-nvim null-ls-nvim plenary-nvim + - (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) + (nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars)) + playground (fetchPluginFromGit "klen/nvim-test" "32f162c27045fc712664b9ddbd33d3c550cb2bfc") (fetchPluginFromGit "mvinkio/tnychain" "cef72f688e67f40616db8ecf9d7c63e505c2dd23") diff --git a/neovim/init.lua b/neovim/init.lua index 542348c..2daa115 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -93,7 +93,6 @@ vim.opt.wmw = 10 vim.opt.isfname:append("@-@") vim.opt.diffopt:append("vertical") vim.opt.shortmess:append("c") -vim.opt.shell = "/bin/zsh" -- }}} -- load global and utility functions diff --git a/neovim/lua/vimrc.lua b/neovim/lua/vimrc.lua index fc40e80..f8ae213 100644 --- a/neovim/lua/vimrc.lua +++ b/neovim/lua/vimrc.lua @@ -27,7 +27,14 @@ function M.setup_treesitter() -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages }, + incremental_selection = { + enable = true, + }, + indent = { + enable = true, + }, } + vim.cmd [[hi link TSParameter Todo]] end function M.setup_rest_nvim() |
