From f1d4be3d2dcb3b1b770c18bf524da76d0abe2e9c Mon Sep 17 00:00:00 2001 From: iFargle Date: Thu, 8 Feb 2024 11:17:11 +0900 Subject: [PATCH] Test nixvim --- flake.nix | 4 +- home-manager/common/software/cli/default.nix | 3 +- .../software/cli/neovim/custom/plugins.lua | 49 ------------------- .../common/software/cli/neovim/default.nix | 40 --------------- home-manager/common/software/cli/nixvim.nix | 38 ++++++++++++++ 5 files changed, 42 insertions(+), 92 deletions(-) delete mode 100644 home-manager/common/software/cli/neovim/custom/plugins.lua delete mode 100644 home-manager/common/software/cli/neovim/default.nix create mode 100644 home-manager/common/software/cli/nixvim.nix diff --git a/flake.nix b/flake.nix index 7de327ce..ff1428e8 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,9 @@ compose2nix.inputs.nixpkgs.follows = "nixpkgs"; # Hyprland Flake hyprland.url = "github:hyprwm/Hyprland"; - + # nixvim - neovim configuration management in nix + nixvim.url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-wayland, home-manager, lanzaboote, nur, sops-nix, doom-emacs, nixos-generators, deploy-rs, ... } @inputs: let diff --git a/home-manager/common/software/cli/default.nix b/home-manager/common/software/cli/default.nix index 7d767b8a..be520134 100644 --- a/home-manager/common/software/cli/default.nix +++ b/home-manager/common/software/cli/default.nix @@ -7,7 +7,6 @@ ./neofetch.nix ./ranger.nix ./ssh.nix - - ./neovim + ./nixvim.nix ]; } \ No newline at end of file diff --git a/home-manager/common/software/cli/neovim/custom/plugins.lua b/home-manager/common/software/cli/neovim/custom/plugins.lua deleted file mode 100644 index 26f9c4c6..00000000 --- a/home-manager/common/software/cli/neovim/custom/plugins.lua +++ /dev/null @@ -1,49 +0,0 @@ - -local overrides = require("custom.configs.overrides") - ----@type NvPluginSpec[] -local plugins = { - - -- Override plugin definition options - -- override plugin configs - { - "williamboman/mason.nvim", - opts = overrides.mason - }, - - { - "nvim-treesitter/nvim-treesitter", - opts = overrides.treesitter, - }, - - { - "nvim-tree/nvim-tree.lua", - opts = overrides.nvimtree, - }, - - -- Install a plugin - { - "max397574/better-escape.nvim", - event = "InsertEnter", - config = function() - require("better_escape").setup() - end, - }, - - -- vim-fugitive for integrated Git - { - "tpope/vim-fugitive", - event = "VeryLazy", - }, - -- fzf fuzzyfinder - { - "vijaymarupudi/nvim-fzf", - event = "InsertEnter", - config = function() - require("nvim-fzf").setup() - end, - }, - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } -} - -return plugins \ No newline at end of file diff --git a/home-manager/common/software/cli/neovim/default.nix b/home-manager/common/software/cli/neovim/default.nix deleted file mode 100644 index c78d4865..00000000 --- a/home-manager/common/software/cli/neovim/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{config, pkgs, ... }: { - programs.neovim = { - package = pkgs.neovim-unwrapped; - enable = true; - defaultEditor = true; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - plugins = with pkgs.vimPlugins; [ - nvchad - ]; - }; - - # nvchad requires gcc, npm, and unzip - home.packages = [ - pkgs.gcc - pkgs.unzip - pkgs.nodejs_20 - pkgs.ripgrep - pkgs.fd - pkgs.lazygit - pkgs.fzf - pkgs.cmake #fzf plugin - ]; - - # Link the nvchad files to my homedir - # https://mipmip.github.io/home-manager-option-search/?query=xdg.dataFile - xdg.configFile."nvim" = { - enable = true; - recursive = true; - source = "${pkgs.vimPlugins.nvchad}/"; - target = "./nvim"; - }; - - xdg.configFile."nvim-custom-plugins" = { - enable = true; - target = "./nvim/lua/custom/plugins.lua"; - text = builtins.readFile ./custom/plugins.lua; - }; -} diff --git a/home-manager/common/software/cli/nixvim.nix b/home-manager/common/software/cli/nixvim.nix new file mode 100644 index 00000000..5aeb5e21 --- /dev/null +++ b/home-manager/common/software/cli/nixvim.nix @@ -0,0 +1,38 @@ +{ inputs, pkgs, config, lib, ... }: { + imports = [ + inputs.nixvim.homeManagerModules.nixvim + ]; + + programs.nixvim = { + enable = true; + options = { + number = true; + shiftwidth = 2; + + }; + plugins = { + lualine.enable = true; + treesitter.enable = true; + telescope.enable = true; + rainbow-delimiters.enable = true; + nvim-tree.enable = true; + nvim-colorizer.enable = true; + nvim-cmp.enable = true; + nix.enable = true; + nix-develop.enable = true; + fugitive.enable = true; + }; + colorschemes = { + tokyonight.enable = true; + gruvbox.enable = true; + dracula.enable = true; + base16.enable = true; + catpuccin.enable = true; + }; + + extraPlugins = with pkgs.vimPlugins [ + everforest + ]; + + }; +} \ No newline at end of file