From bad90f15eda97c8ab077da95c13e26730473c6f3 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sat, 24 Aug 2024 22:20:28 -0700 Subject: [PATCH] feat: move neovim to external flake --- flake.lock | 305 ++++++++++- flake.nix | 8 +- hosts/adrastea/default.nix | 5 +- hosts/callisto/default.nix | 5 +- hosts/demeter/default.nix | 3 +- users/youwen/common/neovim/default.nix | 685 ------------------------- 6 files changed, 305 insertions(+), 706 deletions(-) delete mode 100644 users/youwen/common/neovim/default.nix diff --git a/flake.lock b/flake.lock index a613f6e..045960a 100755 --- a/flake.lock +++ b/flake.lock @@ -92,6 +92,28 @@ } }, "devshell": { + "inputs": { + "nixpkgs": [ + "neovim-config", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "owner": "numtide", + "repo": "devshell", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "devshell_2": { "inputs": { "nixpkgs": [ "nixvim", @@ -158,6 +180,20 @@ } }, "flake-compat_4": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_5": { "flake": false, "locked": { "lastModified": 1696426674, @@ -195,6 +231,28 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-config", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "nixvim", @@ -287,6 +345,24 @@ "type": "github" } }, + "flake-utils_5": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flakey-profile": { "locked": { "lastModified": 1712898590, @@ -305,10 +381,43 @@ "git-hooks": { "inputs": { "flake-compat": [ + "neovim-config", "nixvim", "flake-compat" ], "gitignore": "gitignore_2", + "nixpkgs": [ + "neovim-config", + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "neovim-config", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724440431, + "narHash": "sha256-9etXEOUtzeMgqg1u0wp+EdwG7RpmrAZ2yX516bMj2aE=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "c8a54057aae480c56e28ef3e14e4960628ac495b", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_2": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore_3", "nixpkgs": [ "nixvim", "nixpkgs" @@ -355,6 +464,29 @@ } }, "gitignore_2": { + "inputs": { + "nixpkgs": [ + "neovim-config", + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_3": { "inputs": { "nixpkgs": [ "nixvim", @@ -397,6 +529,28 @@ } }, "home-manager_2": { + "inputs": { + "nixpkgs": [ + "neovim-config", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { "inputs": { "nixpkgs": [ "nixvim", @@ -511,7 +665,50 @@ "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz" } }, + "neovim-config": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "nixvim": "nixvim" + }, + "locked": { + "lastModified": 1724563061, + "narHash": "sha256-zqau1Lht9uQUpUJSd+PQrfP8KmiScnIWU6cqtCWDdiw=", + "owner": "youwen5", + "repo": "neovim-flake", + "rev": "d3c24e0adc3d633d08953ccee4d6a190f489fea3", + "type": "github" + }, + "original": { + "owner": "youwen5", + "repo": "neovim-flake", + "type": "github" + } + }, "nix-darwin": { + "inputs": { + "nixpkgs": [ + "neovim-config", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724469941, + "narHash": "sha256-+U5152FwmDD9EUOiFi5CFxCK6/yFESyDei9jEIlmUtI=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "ea319a737939094b48fda9063fa3201ef2479aac", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-darwin_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -531,7 +728,7 @@ "type": "github" } }, - "nix-darwin_2": { + "nix-darwin_3": { "inputs": { "nixpkgs": "nixpkgs" }, @@ -549,7 +746,7 @@ "type": "github" } }, - "nix-darwin_3": { + "nix-darwin_4": { "inputs": { "nixpkgs": [ "nixvim", @@ -573,8 +770,8 @@ "nix-homebrew": { "inputs": { "brew-src": "brew-src", - "flake-utils": "flake-utils_3", - "nix-darwin": "nix-darwin_2", + "flake-utils": "flake-utils_4", + "nix-darwin": "nix-darwin_3", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -659,13 +856,42 @@ "flake-parts": "flake-parts_2", "git-hooks": "git-hooks", "home-manager": "home-manager_2", - "nix-darwin": "nix-darwin_3", + "nix-darwin": "nix-darwin", "nixpkgs": [ + "neovim-config", "nixpkgs" ], "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix" }, + "locked": { + "lastModified": 1724528976, + "narHash": "sha256-5W13nD/5ySIsxSvDqXHlj4bg2F3tNcYGKCGudWzpNzw=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "8234ee85eaa2c8b7f2c74f5b4cdf02c4965b07fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "nixvim_2": { + "inputs": { + "devshell": "devshell_2", + "flake-compat": "flake-compat_4", + "flake-parts": "flake-parts_3", + "git-hooks": "git-hooks_2", + "home-manager": "home-manager_3", + "nix-darwin": "nix-darwin_4", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch_2", + "treefmt-nix": "treefmt-nix_2" + }, "locked": { "lastModified": 1724222231, "narHash": "sha256-IFlMn1lgVsZQZC9WklY9YKcCdI0mUxSYZ7EfkaKCsQU=", @@ -682,7 +908,30 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "neovim-config", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723969429, + "narHash": "sha256-BuewfNEXEf11MIkJY+uvWsdLu1dIvgJqntWChvNdALg=", + "owner": "NuschtOS", + "repo": "search", + "rev": "a05d1805f2a2bc47d230e5e92aecbf69f784f3d0", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "nuschtosSearch_2": { + "inputs": { + "flake-utils": "flake-utils_5", "nixpkgs": [ "nixvim", "nixpkgs" @@ -739,10 +988,11 @@ "homebrew-core": "homebrew-core", "lanzaboote": "lanzaboote", "lix-module": "lix-module", - "nix-darwin": "nix-darwin", + "neovim-config": "neovim-config", + "nix-darwin": "nix-darwin_2", "nix-homebrew": "nix-homebrew", "nixpkgs": "nixpkgs_3", - "nixvim": "nixvim", + "nixvim": "nixvim_2", "spicetify": "spicetify", "stablepkgs": "stablepkgs" } @@ -790,7 +1040,7 @@ }, "spicetify": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_5", "nixpkgs": [ "nixpkgs" ] @@ -885,7 +1135,44 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "neovim-config", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724338379, + "narHash": "sha256-kKJtaiU5Ou+e/0Qs7SICXF22DLx4V/WhG1P6+k4yeOE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "070f834771efa715f3e74cd8ab93ecc96fabc951", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { "inputs": { "nixpkgs": [ "nixvim", diff --git a/flake.nix b/flake.nix index 7d92eaa..5b73d7b 100755 --- a/flake.nix +++ b/flake.nix @@ -49,13 +49,13 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nixvim = { - url = "github:nix-community/nixvim"; + spicetify = { + url = "github:Gerg-L/spicetify-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - spicetify = { - url = "github:Gerg-L/spicetify-nix"; + neovim-config = { + url = "github:youwen5/neovim-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; }; diff --git a/hosts/adrastea/default.nix b/hosts/adrastea/default.nix index f15f779..78dc60c 100644 --- a/hosts/adrastea/default.nix +++ b/hosts/adrastea/default.nix @@ -15,7 +15,6 @@ catppuccin.nixosModules.catppuccin lix-module.nixosModules.default - # lanzaboote.nixosModules.lanzaboote home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; @@ -34,8 +33,8 @@ ../../users/youwen/common/neovim ../../users/youwen/common ../../users/youwen/common/neofetch - inputs.catppuccin.homeManagerModules.catppuccin - inputs.nixvim.homeManagerModules.nixvim + catppuccin.homeManagerModules.catppuccin + neovim-config.homeManagerModules.default ]; }; } diff --git a/hosts/callisto/default.nix b/hosts/callisto/default.nix index 3ee2b16..232dad5 100644 --- a/hosts/callisto/default.nix +++ b/hosts/callisto/default.nix @@ -31,9 +31,8 @@ ../../users/youwen/linux/packages/aarch-64 ../../users/youwen/common/neovim ./home-manager-extras - - inputs.catppuccin.homeManagerModules.catppuccin - inputs.nixvim.homeManagerModules.nixvim + neovim-config.homeManagerModules.default + catppuccin.homeManagerModules.catppuccin ]; }; } diff --git a/hosts/demeter/default.nix b/hosts/demeter/default.nix index ae7cd12..9d17948 100644 --- a/hosts/demeter/default.nix +++ b/hosts/demeter/default.nix @@ -32,12 +32,11 @@ ../../users/youwen/linux/packages/x86_64 ../../users/youwen/linux/programs ../../users/youwen/common/neofetch - ../../users/youwen/common/neovim ../../users/youwen/common ../../users/youwen/linux/spicetify ./home-manager-extras catppuccin.homeManagerModules.catppuccin - nixvim.homeManagerModules.nixvim + neovim-config.homeManagerModules.default ]; }; } diff --git a/users/youwen/common/neovim/default.nix b/users/youwen/common/neovim/default.nix deleted file mode 100644 index 6c27229..0000000 --- a/users/youwen/common/neovim/default.nix +++ /dev/null @@ -1,685 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - enable = true; - viAlias = true; - vimAlias = true; - withNodeJs = true; - withRuby = true; - - extraPackages = with pkgs; [ - # TS/JS - nodePackages.prettier - - # Rust - rust-analyzer - rustfmt - - # Nix - alejandra - - # Python - black - - # Lua - stylua - lua-language-server - - # Haskell - haskellPackages.fourmolu - - # Misc - codespell - ripgrep - yazi - fd - ]; - - luaLoader.enable = true; - performance = { - combinePlugins.enable = true; - byteCompileLua.enable = true; - }; - - colorschemes.rose-pine.enable = true; - - opts = { - laststatus = 3; - relativenumber = true; - number = true; - }; - - globals = { - mapleader = " "; - }; - - extraConfigLua = '' - require("telescope").load_extension("yank_history") - vim.diagnostic.config({ virtual_lines = false }); - ''; - - keymaps = [ - { - # Unmap space (leader) - action = ""; - key = ""; - options = { - noremap = true; - silent = true; - }; - mode = "n"; - } - { - action = "spj"; - key = "-"; - options.silent = true; - options.desc = "Split window horizontally"; - } - { - action = "vspl"; - key = "\\"; - options.silent = true; - options.desc = "Split window vertically"; - } - { - action = "ZenMode"; - key = "wz"; - options = { - silent = true; - noremap = true; - desc = "Zen mode"; - }; - } - { - action = "h"; - key = ""; - options = { - silent = true; - noremap = true; - desc = "Move to left window"; - }; - } - { - action = "j"; - key = ""; - options = { - silent = true; - noremap = true; - desc = "Move to lower window"; - }; - } - { - action = "k"; - key = ""; - options = { - silent = true; - noremap = true; - desc = "Move to upper window"; - }; - } - { - action = "l"; - key = ""; - options = { - silent = true; - noremap = true; - desc = "Move to right window"; - }; - } - { - action = "close"; - key = "wd"; - options = { - silent = true; - noremap = true; - desc = "Close current window"; - }; - } - { - action = "Telescope find_files"; - key = "ff"; - options = { - silent = true; - noremap = true; - desc = "Find files"; - }; - } - { - action = "Telescope live_grep"; - key = "/"; - options = { - silent = true; - noremap = true; - desc = "Live grep"; - }; - } - { - action = "Telescope buffers"; - key = "fb"; - options = { - silent = true; - noremap = true; - desc = "List buffers"; - }; - } - { - action = "Telescope help_tags"; - key = "fh"; - options = { - silent = true; - noremap = true; - desc = "Help tags"; - }; - } - { - action = "lua require'telescope.builtin'.lsp_definitions{}"; - key = "gd"; - options = { - silent = true; - noremap = true; - desc = "Go to definition"; - }; - } - { - action = "lua require'telescope.builtin'.git_files{}"; - key = " "; - options = { - silent = true; - noremap = true; - desc = "List Git files"; - }; - } - { - action = "lua require'telescope.builtin'.find_files{}"; - key = "ff"; - options = { - silent = true; - noremap = true; - desc = "List all files"; - }; - } - { - action = ""; - key = ""; - options = { - silent = true; - noremap = true; - desc = "Go to normal mode in built-in terminal."; - }; - mode = "t"; - } - { - action = ":resize +4"; - key = "w="; - options = { - silent = true; - noremap = true; - desc = "Increase window height."; - }; - } - { - action = ":resize -4"; - key = "w-"; - options = { - silent = true; - noremap = true; - desc = "Decrease window height."; - }; - } - { - action = ":vertical resize +4"; - key = "w]"; - options = { - silent = true; - noremap = true; - desc = "Increase window width."; - }; - } - { - action = ":vertical resize -4"; - key = "w["; - options = { - silent = true; - noremap = true; - desc = "Decrease window width."; - }; - } - { - action = ":Bdelete!"; - key = "bd"; - options = { - silent = true; - noremap = true; - desc = "Close buffer"; - }; - } - { - action = ":bprev"; - key = "H"; - options = { - silent = true; - noremap = true; - desc = "Move to the previous buffer."; - }; - } - { - action = ":bnext"; - key = "L"; - options = { - silent = true; - noremap = true; - desc = "Move to the next buffer."; - }; - } - { - action = ":LazyGit"; - key = "gg"; - options = { - silent = true; - noremap = true; - desc = "Open LazyGit"; - }; - } - { - action = ":split | wincmd j | resize 15 | term"; - key = "tt"; - options = { - silent = true; - noremap = true; - desc = "Open a half-size horizontal terminal split"; - }; - mode = "n"; - } - { - action = ":split | wincmd j | term"; - key = "te"; - options = { - silent = true; - noremap = true; - desc = "Open a horizontal terminal split"; - }; - mode = "n"; - } - { - action = ":vsplit | wincmd l | term"; - key = "tv"; - options = { - silent = true; - noremap = true; - desc = "Open a vertical terminal split"; - }; - mode = "n"; - } - { - action = ":Trouble diagnostics"; - key = "xx"; - options = { - silent = true; - noremap = true; - desc = "View trouble diagnostics"; - }; - mode = "n"; - } - { - action = ":Trouble symbols"; - key = "xs"; - options = { - silent = true; - noremap = true; - desc = "View symbols"; - }; - mode = "n"; - } - { - action = "(YankyPutAfter)"; - key = "p"; - mode = ["n" "x"]; - } - { - action = "(YankyPutBefore)"; - key = "P"; - mode = ["n" "x"]; - } - { - action = "(YankyGPutAfter)"; - key = "gp"; - mode = ["n" "x"]; - } - { - action = "(YankyGPutBefore)"; - key = "gP"; - mode = ["n" "x"]; - } - { - action = ":Telescope yank_history"; - key = "p"; - mode = "n"; - } - { - action = '':lua require("yazi").yazi()''; - key = "mm"; - options = { - desc = "Open Yazi current nvim working directory"; - noremap = true; - silent = true; - }; - } - { - action = '':lua vim.lsp.buf.code_action()''; - key = "ca"; - options = { - desc = "View available code actions"; - noremap = true; - silent = true; - }; - } - { - action = '':lua vim.lsp.buf.rename()''; - key = "cr"; - options = { - desc = "Rename symbol"; - noremap = true; - silent = true; - }; - } - { - action = '':lua require("lsp_lines").toggle()''; - key = "cd"; - options = { - desc = "Toggle lsp lines"; - noremap = true; - silent = true; - }; - } - # { - # action = ":Yazi"; - # key = "mf"; - # options = { - # desc = "Open Yazi at current file"; - # noremap = true; - # silent = true; - # }; - # } - # { - # action = "lua require'conform'.format({ bufnr = args.bf })"; - # key = "cf"; - # options = { - # silent = true; - # noremap = true; - # desc = "Format buffer"; - # }; - # } - ]; - - plugins = { - # LSP and Treesitter related - lsp = { - enable = true; - inlayHints = true; - servers = { - bashls.enable = true; - clangd.enable = true; - pyright.enable = true; - nixd.enable = true; - nushell.enable = true; - svelte.enable = true; - tailwindcss.enable = true; - typst-lsp.enable = true; - marksman.enable = true; - }; - }; - treesitter = { - enable = true; - settings = { - highlight.enable = true; - indent.enable = true; - folding.enable = true; - }; - }; - lsp-lines.enable = true; - crates-nvim.enable = true; - treesitter-context.enable = true; - - # Language specific tools - markdown-preview.enable = true; - # rustaceanvim.enable = true; - typescript-tools.enable = true; - - # git stuff - lazygit.enable = true; - gitsigns.enable = true; - - # QoL and utility - intellitab.enable = true; - guess-indent.enable = true; - vim-bbye.enable = true; - indent-blankline.enable = true; - which-key.enable = true; - zen-mode.enable = true; - nvim-autopairs.enable = true; - yanky = { - enable = true; - enableTelescope = true; - }; - telescope = { - enable = true; - extensions = { - ui-select = { - enable = true; - settings = { - codeactions = true; - }; - }; - media-files = { - enable = true; - settings = { - filetypes = [ - "png" - "webp" - "jpg" - "jpeg" - "mp4" - "svg" - "pdf" - "mov" - "mkv" - "avi" - ]; - find_cmd = "rg"; - }; - dependencies = { - imageMagick.enable = true; - pdftoppm.enable = true; - ffmpegthumbnailer.enable = true; - }; - }; - }; - }; - trouble.enable = true; - direnv.enable = true; - yazi = { - enable = true; - settings = { - open_for_directories = true; - }; - }; - harpoon = { - enable = true; - keymaps = { - addFile = "hh"; - cmdToggleQuickMenu = "hm"; - gotoTerminal = { - "1" = "ht"; - "2" = "2"; - "3" = "3"; - "4" = "4"; - }; - navFile = { - "1" = "ha"; - "2" = "hs"; - "3" = "hd"; - "4" = "hf"; - }; - navNext = "h]"; - navPrev = "h["; - toggleQuickMenu = "hk"; - }; - }; - - # Code formatting - conform-nvim = { - enable = true; - formatOnSave = { - timeoutMs = 500; - lspFallback = true; - }; - formattersByFt = { - lua = ["stylua"]; - python = ["black"]; - nix = ["alejandra"]; - svelte = ["prettier"]; - rust = ["rustfmt"]; - haskell = ["fourmolu"]; - "*" = ["codespell"]; - "_" = ["trim_whitespace"]; - }; - }; - - # mini.nvim - mini = { - enable = true; - modules = { - surround = {}; - ai = {}; - hipatterns = {}; - notify = {}; - tabline = {}; - trailspace = {}; - comment = {}; - cursorword = {}; - bracketed = {}; - }; - }; - - # Completion - cmp-async-path.enable = true; - cmp = { - enable = true; - settings = { - autoEnableSources = true; - experimental = {ghost_text = true;}; - performance = { - debounce = 60; - fetchingTimeout = 200; - maxViewEntries = 30; - }; - snippet = {expand = "luasnip";}; - formatting = {fields = ["kind" "abbr" "menu"];}; - sources = [ - {name = "nvim_lsp";} - {name = "emoji";} - { - name = "buffer"; # text within current buffer - option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; - keywordLength = 3; - } - # { name = "copilot"; } # enable/disable copilot - { - name = "path"; # file system paths - keywordLength = 3; - } - { - name = "luasnip"; # snippets - keywordLength = 3; - } - ]; - - window = { - completion = {border = "solid";}; - documentation = {border = "solid";}; - }; - - mapping = { - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - "" = "cmp.mapping.abort()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; - }; - }; - }; - cmp-nvim-lsp = { - enable = true; # LSP - }; - cmp-buffer = { - enable = true; - }; - cmp-path = { - enable = true; # file system paths - }; - cmp-cmdline = { - enable = true; # autocomplete for cmdline - }; - - # Extra (stuff that doesn't affect editing) - wakatime.enable = true; - presence-nvim = { - enable = true; - editingText = "Hacking %s"; - workspaceText = "The One True Text Editor"; - buttons = [ - { - label = "GitHub"; - url = "https://github.com/youwen5"; - } - { - label = "Code Forge"; - url = "https://code.youwen.dev/"; - } - ]; - }; - }; - - extraPlugins = [ - (pkgs.vimUtils.buildVimPlugin { - name = "satellite.nvim"; - src = pkgs.fetchFromGitHub { - owner = "lewis6991"; - repo = "satellite.nvim"; - rev = "777ed56e1ef45ec808df701730b6597fc4fb0fbc"; - hash = "sha256-04Js+9SB4VuCq/ACbNh5BZcolu8i8vlGU72qo5xxfpk="; - }; - }) - (pkgs.vimUtils.buildVimPlugin { - name = "render-markdown.nvim"; - src = pkgs.fetchFromGitHub { - owner = "MeanderingProgrammer"; - repo = "render-markdown.nvim"; - rev = "7986be47531d652e950776536987e01dd5b55b94"; - hash = "sha256-lc++IrXzEA3M2iUFZACAZOcH2EwVqX4p0fhET+en37o="; - }; - }) - (pkgs.vimUtils.buildVimPlugin { - name = "haskell-tools-nvim"; - src = pkgs.fetchFromGitHub { - owner = "mrcjkb"; - repo = "haskell-tools.nvim"; - rev = "959eac0fadbdd27442904a8cb363f39afb528027"; - hash = "sha256-5CS5kvUSqQJe7iFFpicinBjCQXgFPL0ElGgnrZHTT+Y="; - }; - }) - (pkgs.vimUtils.buildVimPlugin { - name = "rustaceanvim"; - src = pkgs.fetchFromGitHub { - owner = "mrcjkb"; - repo = "rustaceanvim"; - rev = "7cba8e599deca98d4b44cac1bcbd720c62937d90"; - hash = "sha256-OYfeJuo4FZUBdW9wGGCT0lZGYr/ur1uy8frcyUJMF3k="; - }; - }) - ]; - }; -}