From 3c6023ef4db82cfa0ae7841d2adf7c6eb05e1a09 Mon Sep 17 00:00:00 2001 From: Cookiez Date: Tue, 2 Sep 2025 10:07:36 +0200 Subject: [PATCH] Added neovim lazyvim Plugin. Reconfigured Nerdfonts to work again. --- configuration.nix | 7 +--- home.nix | 3 +- neovim-home.nix | 98 +++++++++++++++++++++++++++++++++++++++++++++++ neovim.nix | 32 ++++------------ packages.nix | 1 + 5 files changed, 109 insertions(+), 32 deletions(-) create mode 100644 neovim-home.nix diff --git a/configuration.nix b/configuration.nix index 68351c1..4dd453f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -126,8 +126,7 @@ fonts.packages = with pkgs; [ font-awesome - #TODO reconfigure nerd fonts!!! - #nerd-fonts + nerd-fonts.jetbrains-mono meslo-lgs-nf ]; @@ -167,12 +166,8 @@ environment.etc."gitconfig".text = '' [init] defaultBranch = main - [credentials] - helper = store --file /etc/git-credentials ''; - environment.etc."git-credentials".text = ''''; - #So no user in the group Wheel has to input the password in order to use sudo security.sudo.wheelNeedsPassword = false; diff --git a/home.nix b/home.nix index bb2f2db..caa4f67 100644 --- a/home.nix +++ b/home.nix @@ -10,7 +10,7 @@ inputs.zen-browser.homeModules.beta # or inputs.zen-browser.homeModules.twilight # or inputs.zen-browser.homeModules.twilight-official - #./hyprland/hyprland-home.nix + ./neovim-home.nix ] ++ lib.optional hyprlandEnabled ./hyprland/hyprland-home.nix; @@ -36,6 +36,7 @@ extraConfig = { init.defaultBranch = "main"; + credentials.helper = "store"; }; }; diff --git a/neovim-home.nix b/neovim-home.nix new file mode 100644 index 0000000..5b52a06 --- /dev/null +++ b/neovim-home.nix @@ -0,0 +1,98 @@ +{ config, lib, pkgs, ... }: +{ + programs.neovim = { + enable = true; + # ... + extraPackages = with pkgs.vimPlugins; [ + lazy-nvim + LazyVim + + bufferline-nvim +# stylua +# ripgrep + ]; + + extraLuaConfig = + let + plugins = with pkgs.vimPlugins; [ + LazyVim + bufferline-nvim + cmp-buffer + cmp-nvim-lsp + cmp-path + cmp_luasnip + conform-nvim + dashboard-nvim + dressing-nvim + flash-nvim + friendly-snippets + gitsigns-nvim + indent-blankline-nvim + lualine-nvim + neo-tree-nvim + neoconf-nvim + neodev-nvim + noice-nvim + nui-nvim + nvim-cmp + nvim-lint + nvim-lspconfig + nvim-notify + nvim-spectre + nvim-treesitter + nvim-treesitter-context + nvim-treesitter-textobjects + nvim-ts-autotag + nvim-ts-context-commentstring + nvim-web-devicons + persistence-nvim + plenary-nvim + telescope-fzf-native-nvim + telescope-nvim + todo-comments-nvim + tokyonight-nvim + trouble-nvim + vim-illuminate + vim-startuptime + which-key-nvim + { name = "LuaSnip"; path = luasnip; } + { name = "catppuccin"; path = catppuccin-nvim; } + ]; + + mkEntryFromDrv = drv: + if lib.isDerivation drv then { name = "${lib.getName drv}"; path = drv; } + else drv; + + lazyPath = pkgs.linkFarm "lazy-plugins" (builtins.map mkEntryFromDrv plugins); + in + '' + vim.opt.clipboard = "unnamedplus" + + vim.opt.rtp:prepend("${pkgs.vimPlugins.lazy-nvim}") + + require("lazy").setup({ + defaults = { lazy = true }, + dev = { + path = "${lazyPath}", + patterns = { "" }, + fallback = true, + }, + spec = { + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + { "nvim-telescope/telescope-fzf-native.nvim", enabled = true }, + { "williamboman/mason-lspconfig.nvim", enabled = false }, + { "williamboman/mason.nvim", enabled = false }, + { import = "plugins" }, + { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } }, + }, + }) + + ''; +# extraLuaConfig = +# # lua +# '' +# vim.opt.clipboard = "unnamedplus" +# vim.opt.shiftwidth = 2 +# ''; + }; +} diff --git a/neovim.nix b/neovim.nix index 46dfd55..4821e30 100644 --- a/neovim.nix +++ b/neovim.nix @@ -3,31 +3,13 @@ environment.systemPackages = with pkgs; [ neovim - #vimPlugins.LazyVim + vimPlugins.LazyVim + vimPlugins.lazygit-nvim + wl-clipboard + xclip ]; - programs.neovim = { - enable = true; - # ... - #extraPackages = with pkgs.vimPlugins; [ - # - # LazyVim - #]; - - #extraLuaConfig = - ## lua - #'' - # require("lazy").setup({ - # -- disable all update / install features - # -- this is handled by nix - # rocks = { enabled = false }, - # pkg = { enabled = false }, - # install = { missing = false }, - # change_detection = { enabled = false }, - # spec = { - # -- TODO - # }, - # }) - #''; - }; +# programs.neovim = { +# enable = true; +#}; } diff --git a/packages.nix b/packages.nix index f7e1f35..4ae0740 100644 --- a/packages.nix +++ b/packages.nix @@ -69,6 +69,7 @@ cloudflare-warp ddrescue texliveFull #LaTeX PDF maker + lazygit ]; nixpkgs.config.permittedInsecurePackages = [