From 9ef04116807b2ec1eafb7dd3db3ff65010262708 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 25 Jan 2024 01:00:00 +0000 Subject: [PATCH] Use Neovim from the flake in opdavies.nvim --- flake.lock | 12 +- system/shared/home-manager.nix | 2 +- system/shared/modules/neovim.nix | 251 +------------------------------ 3 files changed, 10 insertions(+), 255 deletions(-) diff --git a/flake.lock b/flake.lock index 048e708..9c25475 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ ] }, "locked": { - "lastModified": 1706099765, - "narHash": "sha256-pt98CX+WkTwtnDdu+9kGnuia/3s5krsUqYOSGOYbuHk=", + "lastModified": 1706134977, + "narHash": "sha256-KwNb1Li3K6vuVwZ77tFjZ89AWBo7AiCs9t0Cens4BsM=", "owner": "nix-community", "repo": "home-manager", - "rev": "e84811035d7c8ec79ed6c687a97e19e2a22123c1", + "rev": "6359d40f6ec0b72a38e02b333f343c3d4929ec10", "type": "github" }, "original": { @@ -130,11 +130,11 @@ ] }, "locked": { - "lastModified": 1706088444, - "narHash": "sha256-SUkQwotWRMOHk8U2AKcSRA1Jt7EEvodKUb5t/WApLOs=", + "lastModified": 1706146976, + "narHash": "sha256-nTE0vwU4yDx4K2jTHF9M8YcLRJj5yA1W77Z+zaiVmn0=", "owner": "opdavies", "repo": "opdavies.nvim", - "rev": "fd32fb48877dfbef088af4dd706bb3993b56c750", + "rev": "87bf6146251976fb749d5c2459c4e896c2b35bfa", "type": "github" }, "original": { diff --git a/system/shared/home-manager.nix b/system/shared/home-manager.nix index b66bad6..98ed2f1 100644 --- a/system/shared/home-manager.nix +++ b/system/shared/home-manager.nix @@ -9,7 +9,7 @@ programs.home-manager.enable = true; imports = [ - (import ./modules/neovim.nix { inherit inputs pkgs self; }) + (import ./modules/neovim.nix { inherit inputs; }) ./modules/git.nix ./modules/tmux.nix ./modules/zsh.nix diff --git a/system/shared/modules/neovim.nix b/system/shared/modules/neovim.nix index a9e697d..361647b 100644 --- a/system/shared/modules/neovim.nix +++ b/system/shared/modules/neovim.nix @@ -1,255 +1,10 @@ -{ inputs, pkgs, self, ... }: +{ inputs }: { pkgs, ... }: let - customVim = with self; { - toggle-checkbox-nvim = pkgs.vimUtils.buildVimPlugin { - name = "toggle-checkbox-nvim"; - src = pkgs.fetchFromGitHub { - owner = "opdavies"; - repo = "toggle-checkbox.nvim"; - rev = "main"; - sha256 = "4YSEagQnLK5MBl2z53e6sOBlCDm220GYVlc6A+HNywg="; - }; - }; - - vim-heritage = pkgs.vimUtils.buildVimPlugin { - name = "vim-heritage"; - src = pkgs.fetchFromGitHub { - owner = "jessarcher"; - repo = "vim-heritage"; - rev = "cffa05c78c0991c998adc4504d761b3068547db6"; - sha256 = "Lebe5V1XFxn4kSZ+ImZ69Vst9Nbc0N7eA9IzOCijFS0="; - }; - }; - - vim-textobj-xmlattr = pkgs.vimUtils.buildVimPlugin { - name = "vim-textobj-xmlattr"; - src = pkgs.fetchFromGitHub { - owner = "whatyouhide"; - repo = "vim-textobj-xmlattr"; - rev = "694a297f1d75fd527e87da9769f3c6519a87ebb1"; - sha256 = "+91FVP95oh00flINdltqx6qJuijYo56tHIh3J098G2Q="; - }; - }; - - tabline-vim = pkgs.vimUtils.buildVimPlugin { - name = "tabline-vim"; - src = pkgs.fetchFromGitHub { - owner = "mkitt"; - repo = "tabline.vim"; - rev = "69c9698a3240860adaba93615f44778a9ab724b4"; - sha256 = "51b8PxyKqBdeIvmmZyF2hpMBjkyrlZDdTB1opr5JZ7Y="; - }; - }; - - vim-caser = pkgs.vimUtils.buildVimPlugin { - name = "vim-caser"; - src = pkgs.fetchFromGitHub { - owner = "arthurxavierx"; - repo = "vim-caser"; - rev = "6bc9f41d170711c58e0157d882a5fe8c30f34bf6"; - sha256 = "PXAY01O/cHvAdWx3V/pyWFeiV5qJGvLcAKhl5DQc0Ps="; - }; - }; - - vim-zoom = pkgs.vimUtils.buildVimPlugin { - name = "vim-zoom"; - src = pkgs.fetchFromGitHub { - owner = "dhruvasagar"; - repo = "vim-zoom"; - rev = "01c737005312c09e0449d6518decf8cedfee32c7"; - sha256 = "/ADzScsG0u6RJbEtfO23Gup2NYdhPkExqqOPVcQa7aQ="; - }; - }; - }; + system = pkgs.system; in { - programs.neovim = { - enable = true; - - plugins = with pkgs; [ - customVim.tabline-vim - customVim.vim-caser - customVim.vim-heritage - customVim.vim-textobj-xmlattr - customVim.vim-zoom - vimPlugins.vim-astro - vimPlugins.vim-visual-star-search - - { - plugin = customVim.toggle-checkbox-nvim; - type = "lua"; - config = '' - vim.keymap.set("n", "t", ":lua require('toggle-checkbox').toggle()") - ''; - } - - vimPlugins.harpoon - vimPlugins.refactoring-nvim - vimPlugins.comment-nvim - vimPlugins.dial-nvim - vimPlugins.gitsigns-nvim - vimPlugins.impatient-nvim - vimPlugins.nvim-web-devicons - vimPlugins.rest-nvim - vimPlugins.undotree - vimPlugins.vim-easy-align - vimPlugins.vim-eunuch - vimPlugins.vim-highlightedyank - vimPlugins.vim-nix - vimPlugins.vim-obsession - vimPlugins.vim-pasta - vimPlugins.vim-polyglot - vimPlugins.vim-projectionist - vimPlugins.vim-repeat - vimPlugins.vim-sleuth - vimPlugins.vim-surround - vimPlugins.vim-terraform - vimPlugins.vim-textobj-user - vimPlugins.vim-tmux-navigator - vimPlugins.vim-unimpaired - - vimPlugins.lualine-nvim - - { - plugin = vimPlugins.vim-sort-motion; - type = "lua"; - config = '' - vim.g.sort_motion_flags = "ui" - ''; - } - { - plugin = vimPlugins.treesj; - type = "lua"; - config = '' - require "treesj".setup {} - ''; - } - # Testing. - { - plugin = vimPlugins.neoterm; - type = "lua"; - config = '' - vim.g.neoterm_autoscroll = 1 - vim.g.neoterm_default_mod = "vertical" - vim.g.neoterm_term_per_tab = 1 - ''; - } - vimPlugins.vim-test - - # Git - vimPlugins.vim-fugitive - vimPlugins.vim-rhubarb - - # Debugging - vimPlugins.nvim-dap - vimPlugins.nvim-dap-ui - vimPlugins.nvim-dap-virtual-text - - # Treesitter - vimPlugins.nvim-treesitter.withAllGrammars - vimPlugins.nvim-treesitter-context - vimPlugins.nvim-treesitter-textobjects - - # LSP, linting and formatting - vimPlugins.conform-nvim - vimPlugins.lsp-status-nvim - vimPlugins.none-ls-nvim - vimPlugins.nvim-lspconfig - - # Completion - vimPlugins.cmp-buffer - vimPlugins.cmp-cmdline - vimPlugins.cmp-nvim-lsp - vimPlugins.cmp-nvim-lsp-signature-help - vimPlugins.cmp-path - vimPlugins.cmp-tabnine - vimPlugins.cmp-treesitter - vimPlugins.cmp-vsnip - vimPlugins.cmp_luasnip - vimPlugins.lspkind-nvim - vimPlugins.nvim-cmp - vimPlugins.phpactor - - # Snippets - vimPlugins.friendly-snippets - vimPlugins.luasnip - - # Telescope - vimPlugins.plenary-nvim - vimPlugins.popup-nvim - vimPlugins.telescope-file-browser-nvim - vimPlugins.telescope-frecency-nvim - vimPlugins.telescope-fzf-native-nvim - vimPlugins.telescope-live-grep-args-nvim - vimPlugins.telescope-nvim - vimPlugins.telescope-ui-select-nvim - - # Databases - vimPlugins.vim-dadbod - vimPlugins.vim-dadbod-ui - vimPlugins.vim-dadbod-completion - - # Markdown - { - plugin = vimPlugins.markdown-preview-nvim; - type = "lua"; - config = '' - vim.g.mkdp_refresh_slow = 1 - ''; - } - - # Themes - vimPlugins.catppuccin-nvim - - inputs.opdavies-nvim.packages.${pkgs.system}.default - ]; - - extraLuaConfig = '' - if vim.loader then - vim.loader.enable() - end - - require "opdavies" - ''; - - extraPackages = with pkgs; [ - # Languages - nodePackages.typescript - php81 - - # Language servers - ansible-language-server - gopls - lua-language-server - nixd - nodePackages.intelephense - nodePackages."@astrojs/language-server" - nodePackages."@tailwindcss/language-server" - nodePackages.bash-language-server - nodePackages.dockerfile-language-server-nodejs - nodePackages.typescript-language-server - nodePackages.vls - nodePackages.volar - nodePackages.vscode-langservers-extracted - nodePackages.vue-language-server - nodePackages.yaml-language-server - phpactor - rnix-lsp - terraform-ls - - # Formatters - black - nodePackages.prettier - stylua - - # Tools - html-tidy - nodePackages.markdownlint-cli - proselint - shellcheck - ]; - }; + programs.neovim = inputs.opdavies-nvim.lib.mkHomeManager { inherit system; }; home.file.".markdownlint.yaml".text = '' default: true