From eafd1933061cced3e44c9c637803c39700b169b4 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sat, 27 Jan 2024 10:59:10 +0100 Subject: [PATCH] Migrate nvim from dotter to home-manager --- .dotter/local.laptop.toml | 2 +- home-manager/home.nix | 59 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/.dotter/local.laptop.toml b/.dotter/local.laptop.toml index 3c0d068..4cc077c 100644 --- a/.dotter/local.laptop.toml +++ b/.dotter/local.laptop.toml @@ -1,2 +1,2 @@ includes = [".dotter/laptop.toml"] -packages = ["nvim", "emacs", "i3", "starship", "zsh"] +packages = ["emacs", "i3", "starship", "zsh"] diff --git a/home-manager/home.nix b/home-manager/home.nix index c16f5ef..ee16df2 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -9,9 +9,12 @@ home.packages = with pkgs; [ # Code formatters for use with doom emacs - nixfmt - dockfmt - google-java-format + nixfmt # nix + dockfmt # docker + google-java-format # java + + # Lsps for use with doom emacs + # neocmakelsp # cmake # Rust setup rustc @@ -28,6 +31,56 @@ # '') ]; + programs = { + neovim = let + toLua = str: '' + lua << EOF + ${str} + EOF + ''; + in { + # https://www.youtube.com/watch?v=YZAnJ0rwREA + enable = true; + viAlias = true; + vimAlias = true; + # vimdiffAlias = true; + + plugins = with pkgs.vimPlugins; [ + { + plugin = dracula-nvim; + config = "colorscheme dracula"; + } + { + plugin = comment-nvim; + config = toLua ''require("Comment").setup()''; + } + + # nix file support + vim-nix + + # Syntax highlighting + (nvim-treesitter.withPlugins (p: [ + p.tree-sitter-nix + p.tree-sitter-vim + p.tree-sitter-bash + p.tree-sitter-lua + p.tree-sitter-python + p.tree-sitter-json + p.tree-sitter-cpp + p.tree-sitter-rust + ])) + ]; + + # extraLuaConfig = "\n"; + + extraLuaConfig = '' + vim.o.termguicolors = true + ''; + + }; + + }; + home.file = { # # Building this configuration will create a copy of 'dotfiles/screenrc' in # # the Nix store. Activating the configuration will then make '~/.screenrc' a