Personal Nix setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update neovim overrides and cmp setup

+103 -257
+41 -160
flake.lock
··· 27 27 "type": "github" 28 28 } 29 29 }, 30 + "autocomplete-nvim": { 31 + "flake": false, 32 + "locked": { 33 + "lastModified": 1723229959, 34 + "narHash": "sha256-KqkYKXwY+1BMd+2PdWT08KmUc0Uc+Gk9LPp0e7njlms=", 35 + "owner": "deathbeam", 36 + "repo": "autocomplete.nvim", 37 + "rev": "f600445270d5b2472eacc3c164413760215d48ed", 38 + "type": "github" 39 + }, 40 + "original": { 41 + "owner": "deathbeam", 42 + "repo": "autocomplete.nvim", 43 + "type": "github" 44 + } 45 + }, 30 46 "crane": { 31 47 "inputs": { 32 48 "nixpkgs": [ ··· 165 181 "gitsigns-nvim": { 166 182 "flake": false, 167 183 "locked": { 168 - "lastModified": 1722793486, 169 - "narHash": "sha256-ylXb7eT22MnbH9t2W5T8EXB1u1rNNuGSfxQD5oDeo3s=", 184 + "lastModified": 1725453693, 185 + "narHash": "sha256-s3y8ZuLV00GIhizcK/zqsJOTKecql7Xn3LGYmH7NLsQ=", 170 186 "owner": "lewis6991", 171 187 "repo": "gitsigns.nvim", 172 - "rev": "58bd9e98d8e3c5a1c98af312e85247ee1afd3ed2", 188 + "rev": "1ef74b546732f185d0f806860fa5404df7614f28", 173 189 "type": "github" 174 190 }, 175 191 "original": { ··· 376 392 "type": "github" 377 393 } 378 394 }, 379 - "nvim-cmp-buffer": { 380 - "flake": false, 381 - "locked": { 382 - "lastModified": 1660101488, 383 - "narHash": "sha256-dG4U7MtnXThoa/PD+qFtCt76MQ14V1wX8GMYcvxEnbM=", 384 - "owner": "hrsh7th", 385 - "repo": "cmp-buffer", 386 - "rev": "3022dbc9166796b644a841a02de8dd1cc1d311fa", 387 - "type": "github" 388 - }, 389 - "original": { 390 - "owner": "hrsh7th", 391 - "repo": "cmp-buffer", 392 - "type": "github" 393 - } 394 - }, 395 - "nvim-cmp-cmdline": { 396 - "flake": false, 397 - "locked": { 398 - "lastModified": 1711081050, 399 - "narHash": "sha256-iBmXp+gUSMbgfkv7c7RDQAwPq02e07wEnBETP0dWBOo=", 400 - "owner": "hrsh7th", 401 - "repo": "cmp-cmdline", 402 - "rev": "d250c63aa13ead745e3a40f61fdd3470efde3923", 403 - "type": "github" 404 - }, 405 - "original": { 406 - "owner": "hrsh7th", 407 - "repo": "cmp-cmdline", 408 - "type": "github" 409 - } 410 - }, 411 - "nvim-cmp-cmdline-history": { 412 - "flake": false, 413 - "locked": { 414 - "lastModified": 1651653950, 415 - "narHash": "sha256-IcruTOCNxYKmbo0St1U+CmrDStASPLe+rTLNU6/2Xew=", 416 - "owner": "dmitmel", 417 - "repo": "cmp-cmdline-history", 418 - "rev": "003573b72d4635ce636234a826fa8c4ba2895ffe", 419 - "type": "github" 420 - }, 421 - "original": { 422 - "owner": "dmitmel", 423 - "repo": "cmp-cmdline-history", 424 - "type": "github" 425 - } 426 - }, 427 395 "nvim-cmp-lsp": { 428 396 "flake": false, 429 397 "locked": { ··· 440 408 "type": "github" 441 409 } 442 410 }, 443 - "nvim-cmp-lsp-document-symbol": { 444 - "flake": false, 445 - "locked": { 446 - "lastModified": 1716967041, 447 - "narHash": "sha256-BBvG0/yEyYs+sLPtCYAgZLz9ccGAMBCMhgmwC+gZ3kc=", 448 - "owner": "hrsh7th", 449 - "repo": "cmp-nvim-lsp-document-symbol", 450 - "rev": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf", 451 - "type": "github" 452 - }, 453 - "original": { 454 - "owner": "hrsh7th", 455 - "repo": "cmp-nvim-lsp-document-symbol", 456 - "type": "github" 457 - } 458 - }, 459 411 "nvim-cmp-lsp-signature-help": { 460 412 "flake": false, 461 413 "locked": { ··· 472 424 "type": "github" 473 425 } 474 426 }, 475 - "nvim-cmp-path": { 476 - "flake": false, 477 - "locked": { 478 - "lastModified": 1664784283, 479 - "narHash": "sha256-thppiiV3wjIaZnAXmsh7j3DUc6ceSCvGzviwFUnoPaI=", 480 - "owner": "hrsh7th", 481 - "repo": "cmp-path", 482 - "rev": "91ff86cd9c29299a64f968ebb45846c485725f23", 483 - "type": "github" 484 - }, 485 - "original": { 486 - "owner": "hrsh7th", 487 - "repo": "cmp-path", 488 - "type": "github" 489 - } 490 - }, 491 - "nvim-cmp-snippy": { 492 - "flake": false, 493 - "locked": { 494 - "lastModified": 1697075062, 495 - "narHash": "sha256-suw8AGXLi48hB49otZlS+DzbhwPDC9ql34dX3ufLnNA=", 496 - "owner": "dcampos", 497 - "repo": "cmp-snippy", 498 - "rev": "6e39210aa3a74e2bf6462f492eaf0d436cd2b7d3", 499 - "type": "github" 500 - }, 501 - "original": { 502 - "owner": "dcampos", 503 - "repo": "cmp-snippy", 504 - "type": "github" 505 - } 506 - }, 507 427 "nvim-cmp-treesitter": { 508 428 "flake": false, 509 429 "locked": { ··· 540 460 "nvim-lspconfig": { 541 461 "flake": false, 542 462 "locked": { 543 - "lastModified": 1722924732, 544 - "narHash": "sha256-m6pK80wgTYzQXUaRqnUi3zLS3MINkrfS/bnflstQjaU=", 463 + "lastModified": 1725524791, 464 + "narHash": "sha256-xel86Ebobiv7dgudH3+BfSOoE7XLnvMne8Jj5cItAp4=", 545 465 "owner": "neovim", 546 466 "repo": "nvim-lspconfig", 547 - "rev": "6c505d4220b521f3b0e7b645f6ce45fa914d0eed", 467 + "rev": "bdbc65aadc708ce528efb22bca5f82a7cca6b54d", 548 468 "type": "github" 549 469 }, 550 470 "original": { ··· 555 475 }, 556 476 "nvim-plugins": { 557 477 "inputs": { 478 + "autocomplete-nvim": "autocomplete-nvim", 558 479 "dressing-nvim": "dressing-nvim", 559 480 "flake-utils": [ 560 481 "flake-utils" ··· 568 489 ], 569 490 "null-ls-nvim": "null-ls-nvim", 570 491 "nvim-cmp": "nvim-cmp", 571 - "nvim-cmp-buffer": "nvim-cmp-buffer", 572 - "nvim-cmp-cmdline": "nvim-cmp-cmdline", 573 - "nvim-cmp-cmdline-history": "nvim-cmp-cmdline-history", 574 492 "nvim-cmp-lsp": "nvim-cmp-lsp", 575 - "nvim-cmp-lsp-document-symbol": "nvim-cmp-lsp-document-symbol", 576 493 "nvim-cmp-lsp-signature-help": "nvim-cmp-lsp-signature-help", 577 - "nvim-cmp-path": "nvim-cmp-path", 578 - "nvim-cmp-snippy": "nvim-cmp-snippy", 579 494 "nvim-cmp-treesitter": "nvim-cmp-treesitter", 580 495 "nvim-dap": "nvim-dap", 581 496 "nvim-lspconfig": "nvim-lspconfig", 582 - "nvim-snippy": "nvim-snippy", 583 497 "nvim-treesitter": "nvim-treesitter", 584 - "nvim-treesitter-context": "nvim-treesitter-context", 585 498 "nvim-treesitter-refactor": "nvim-treesitter-refactor", 586 499 "nvim-treesitter-textobjects": "nvim-treesitter-textobjects", 587 500 "plenary-nvim": "plenary-nvim", ··· 595 508 "which-key-nvim": "which-key-nvim" 596 509 }, 597 510 "locked": { 598 - "lastModified": 1723021210, 599 - "narHash": "sha256-Lw8sMae8ikBaUqBMgAppLtwEg9ddG/Eiq4SiPTqHJQE=", 511 + "lastModified": 1725580431, 512 + "narHash": "sha256-G6jALJexW85L8lAl/tvsp9lFl60kjf+on7ri7F+0qYo=", 600 513 "owner": "kitten", 601 514 "repo": "system-nvim-plugins.nix", 602 - "rev": "1cf4a1da15c9c2b5c875698aa371265685a23c46", 515 + "rev": "e5efec8235b20cf92dc06301bf2fe34ef1eee3b5", 603 516 "type": "github" 604 517 }, 605 518 "original": { ··· 608 521 "type": "github" 609 522 } 610 523 }, 611 - "nvim-snippy": { 612 - "flake": false, 613 - "locked": { 614 - "lastModified": 1720842678, 615 - "narHash": "sha256-SpTo4f1J65hcD+ZBTpW4BGV3KeeamxkxbT7eg9r8e7M=", 616 - "owner": "dcampos", 617 - "repo": "nvim-snippy", 618 - "rev": "02a0ac1e16a7190a22bb6e31b15d484442bd2fdd", 619 - "type": "github" 620 - }, 621 - "original": { 622 - "owner": "dcampos", 623 - "repo": "nvim-snippy", 624 - "type": "github" 625 - } 626 - }, 627 524 "nvim-treesitter": { 628 525 "flake": false, 629 526 "locked": { 630 - "lastModified": 1723018736, 631 - "narHash": "sha256-c907wbMB9CfZwAnz+3tNYsHX4LCJnudm7dw0ULi8cF8=", 527 + "lastModified": 1725543382, 528 + "narHash": "sha256-AuYOdtDVCnNx1sJd11VhwH4Gxy0bkDpBTI8JTU00Qpg=", 632 529 "owner": "nvim-treesitter", 633 530 "repo": "nvim-treesitter", 634 - "rev": "88aad97312787c11154afbe16068fc2b1e18b249", 531 + "rev": "bfe74a4899882a4ef45abb80813f14644a110a34", 635 532 "type": "github" 636 533 }, 637 534 "original": { ··· 640 537 "type": "github" 641 538 } 642 539 }, 643 - "nvim-treesitter-context": { 644 - "flake": false, 645 - "locked": { 646 - "lastModified": 1723013539, 647 - "narHash": "sha256-WkikzAwxUij6n9OhXnfNll3mKW0HLYTr3lyNOpBhP3Q=", 648 - "owner": "nvim-treesitter", 649 - "repo": "nvim-treesitter-context", 650 - "rev": "0f3332788e0bd37716fbd25f39120dcfd557c90f", 651 - "type": "github" 652 - }, 653 - "original": { 654 - "owner": "nvim-treesitter", 655 - "repo": "nvim-treesitter-context", 656 - "type": "github" 657 - } 658 - }, 659 540 "nvim-treesitter-refactor": { 660 541 "flake": false, 661 542 "locked": { ··· 675 556 "nvim-treesitter-textobjects": { 676 557 "flake": false, 677 558 "locked": { 678 - "lastModified": 1722853302, 679 - "narHash": "sha256-65xhKeQotSArYMU4Qxl/MOuH1tE4cPXoUT1j1Lxg71A=", 559 + "lastModified": 1725439217, 560 + "narHash": "sha256-k8awnw0QETnYzDH6JeGzmNx/kovFfprCYZm/ybULPtw=", 680 561 "owner": "nvim-treesitter", 681 562 "repo": "nvim-treesitter-textobjects", 682 - "rev": "33a17515b79ddb10d750320fa994098bdc3e93ef", 563 + "rev": "fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73", 683 564 "type": "github" 684 565 }, 685 566 "original": { ··· 691 572 "plenary-nvim": { 692 573 "flake": false, 693 574 "locked": { 694 - "lastModified": 1716230027, 695 - "narHash": "sha256-5Jf2mWFVDofXBcXLbMa417mqlEPWLA+cQIZH/vNEV1g=", 575 + "lastModified": 1724044857, 576 + "narHash": "sha256-6Gm+4zZ80quI5iAW6qPAWTq9h1csPWkZFZ9KnFgYRM0=", 696 577 "owner": "nvim-lua", 697 578 "repo": "plenary.nvim", 698 - "rev": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683", 579 + "rev": "ec289423a1693aeae6cd0d503bac2856af74edaa", 699 580 "type": "github" 700 581 }, 701 582 "original": { ··· 815 696 "telescope-nvim": { 816 697 "flake": false, 817 698 "locked": { 818 - "lastModified": 1722561161, 819 - "narHash": "sha256-F5TGzfPSDQY+AOzaDXStswHjkGQvnLeTWW5/xdBalpo=", 699 + "lastModified": 1723686624, 700 + "narHash": "sha256-rNzfnORvbKoglt20i/rKmlkysPUBlB89F6dRKgB5MKU=", 820 701 "owner": "nvim-telescope", 821 702 "repo": "telescope.nvim", 822 - "rev": "3b1600d0fd5172ad9fae00987362ca0ef3d8895d", 703 + "rev": "5972437de807c3bc101565175da66a1aa4f8707a", 823 704 "type": "github" 824 705 }, 825 706 "original": { ··· 887 768 "vim-fugitive": { 888 769 "flake": false, 889 770 "locked": { 890 - "lastModified": 1721347143, 891 - "narHash": "sha256-NLHaXpPrb4/QuVuTjl6YUUKA3/1r4VCOaNO48Dk9pms=", 771 + "lastModified": 1725302615, 772 + "narHash": "sha256-lFG5zmBPzmDda8LWJ4XjYEpA6QCLOq2hf14qvcHX7Ng=", 892 773 "owner": "tpope", 893 774 "repo": "vim-fugitive", 894 - "rev": "0444df68cd1cdabc7453d6bd84099458327e5513", 775 + "rev": "1d18c696c4284e9ce9467a5c04d3adf8af43f994", 895 776 "type": "github" 896 777 }, 897 778 "original": {
+50 -50
modules/nvim/default.nix
··· 19 19 20 20 hardline_colors = ${mkVimHardlineColors colors} 21 21 '' + (builtins.readFile ./init.lua) + "\nEOF"; 22 + 23 + nvim-treesitter = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ 24 + p.astro p.typescript p.tsx p.git_rebase p.gitcommit p.gitignore 25 + p.gitattributes p.graphql p.regex p.json p.json5 p.javascript 26 + p.markdown p.markdown_inline p.terraform p.svelte p.prisma 27 + p.yaml p.vue p.vim p.lua p.make p.jsdoc p.comment p.css 28 + p.sql p.rust p.html p.bash p.c p.nix p.zig p.yuck p.go 29 + ])).overrideAttrs (_: { 30 + src = pkgs.nvim-plugins.nvim-treesitter; 31 + }); 32 + 33 + neovimConfig = pkgs.neovimUtils.makeNeovimConfig { 34 + withPython3 = true; 35 + viAlias = true; 36 + vimAlias = true; 37 + extraMakeWrapperArgs = "--set TERM wezterm"; 38 + customRC = initContents; 39 + plugins = with pkgs.nvim-plugins; [ 40 + my-theme 41 + vim-repeat 42 + vim-fugitive 43 + hardline-nvim 44 + gitsigns-nvim 45 + nvim-lspconfig 46 + lspkind-nvim 47 + vim-golden-size 48 + lir-nvim 49 + popup-nvim 50 + trouble-nvim 51 + dressing-nvim 52 + which-key-nvim 53 + 54 + nvim-cmp 55 + nvim-cmp-lsp 56 + nvim-cmp-lsp-signature-help 57 + nvim-cmp-treesitter 58 + 59 + plenary-nvim 60 + telescope-nvim 61 + telescope-zf-native-nvim 62 + 63 + nvim-treesitter 64 + nvim-treesitter-refactor 65 + nvim-treesitter-textobjects 66 + ]; 67 + }; 68 + 69 + neovimPkg = pkgs.neovim-unwrapped; 70 + neovim = pkgs.wrapNeovimUnstable neovimPkg neovimConfig; 22 71 in { 23 72 environment.variables = { EDITOR = "vim"; }; 24 73 ··· 26 75 ripgrep 27 76 fd 28 77 bat 29 - (neovim.override { 30 - viAlias = true; 31 - vimAlias = true; 32 - extraMakeWrapperArgs = "--set TERM wezterm"; 33 - configure = { 34 - customRC = initContents; 35 - packages.myVimPackage = with pkgs.nvim-plugins; { 36 - start = [ 37 - my-theme 38 - vim-repeat 39 - vim-fugitive 40 - hardline-nvim 41 - gitsigns-nvim 42 - nvim-lspconfig 43 - lspkind-nvim 44 - vim-golden-size 45 - lir-nvim 46 - popup-nvim 47 - trouble-nvim 48 - dressing-nvim 49 - which-key-nvim 50 - 51 - nvim-cmp 52 - nvim-cmp-lsp 53 - nvim-cmp-lsp-document-symbol 54 - nvim-cmp-lsp-signature-help 55 - nvim-cmp-treesitter 56 - nvim-cmp-path 57 - nvim-cmp-cmdline 58 - nvim-cmp-snippy 59 - nvim-snippy 60 - 61 - nvim-treesitter-refactor 62 - nvim-treesitter-textobjects 63 - 64 - plenary-nvim 65 - telescope-nvim 66 - telescope-zf-native-nvim 67 - 68 - (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ 69 - p.astro p.typescript p.tsx p.git_rebase p.gitcommit p.gitignore 70 - p.gitattributes p.graphql p.regex p.json p.json5 p.javascript 71 - p.markdown p.markdown_inline p.terraform p.svelte p.prisma 72 - p.yaml p.vue p.vim p.lua p.make p.jsdoc p.comment p.css 73 - p.sql p.rust p.html p.bash p.c p.nix p.zig p.yuck p.go 74 - ])) 75 - ]; 76 - }; 77 - }; 78 - }) 78 + neovim 79 79 ]; 80 80 }
+12 -47
modules/nvim/init.lua
··· 131 131 vim.cmd('colorscheme theme') 132 132 133 133 -- misc. options 134 - vim.o.completeopt = 'menuone,noinsert,noselect' 134 + vim.o.completeopt = 'menuone,noinsert,noselect,popup' 135 135 vim.o.pumheight = 10 136 136 vim.o.winblend = 5 137 137 vim.o.backspace = 'indent,eol,start' ··· 450 450 }) 451 451 end 452 452 453 - lsp_setup('tsserver', { 453 + lsp_setup('ts_ls', { 454 454 cmd = { nix_bins.tsserver, "--stdio" }, 455 455 flags = { debounce_text_changes = 200 }, 456 456 single_file_support = false, ··· 650 650 set foldtext=FoldText() 651 651 ]], false) 652 652 653 - -- completion 653 + -- autocompletion 654 654 local cmp = require('cmp') 655 - local snippy = require('snippy') 656 655 657 656 local has_words_before = function() 658 657 local line, col = unpack(vim.api.nvim_win_get_cursor(0)) ··· 695 694 ['<Tab>'] = cmp.mapping(function(fallback) 696 695 if cmp.visible() then 697 696 cmp.select_next_item() 698 - elseif snippy.can_expand_or_advance() then 699 - snippy.expand_or_advance() 700 697 elseif has_words_before() then 701 698 cmp.complete() 702 699 else ··· 706 703 ['<S-Tab>'] = cmp.mapping(function(fallback) 707 704 if cmp.visible() then 708 705 cmp.select_prev_item() 709 - elseif snippy.can_jump(-1) then 710 - snippy.previous() 711 706 else 712 707 fallback() 713 708 end ··· 715 710 }), 716 711 snippet = { 717 712 expand = function(args) 718 - snippy.expand_snippet(args.body) 713 + vim.snippet.expand(args.body) 719 714 end, 720 715 }, 721 716 completion = { 722 717 keyword_length = 3 723 718 }, 719 + view = { 720 + entries = "native", 721 + }, 724 722 experimental = { 725 723 ghost_text = { 726 724 hl_group = 'GhostText', 727 725 }, 728 726 }, 729 - sources = cmp.config.sources( 730 - {{ name = 'nvim_lsp' }, { name = 'nvim_lsp_signature_help' }, { name = 'snippy' }}, 731 - {{ name = 'treesitter' }} 732 - ), 727 + sources = cmp.config.sources({ 728 + { name = 'nvim_lsp_signature_help' }, 729 + { name = 'nvim_lsp' }, 730 + { name = 'treesitter' }, 731 + }), 733 732 formatting = { 734 733 format = require('lspkind').cmp_format(), 735 734 }, ··· 737 736 738 737 cmp.setup.filetype('gitcommit', { 739 738 enabled = false, 740 - }) 741 - 742 - cmp.setup.cmdline('/', { 743 - enabled = function() 744 - return not vim.b[vim.api.nvim_get_current_buf()].big 745 - end, 746 - mapping = cmp.mapping.preset.cmdline({ 747 - ['<CR>'] = cmp.mapping(function(fallback) 748 - if cmp.visible() then 749 - cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) 750 - end 751 - fallback() 752 - end, {"i", "c"}) 753 - }), 754 - sources = cmp.config.sources( 755 - {{ name = 'nvim_lsp_document_symbol' }}, 756 - {{ name = 'cmdline_history' }}, 757 - {{ name = 'treesitter' }, { name = 'buffer', keyword_length = 3 }} 758 - ), 759 - }) 760 - 761 - cmp.setup.cmdline(':', { 762 - mapping = cmp.mapping.preset.cmdline({ 763 - ['<CR>'] = cmp.mapping(function(fallback) 764 - if cmp.visible() then 765 - cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) 766 - end 767 - fallback() 768 - end, {"i", "c"}) 769 - }), 770 - sources = cmp.config.sources( 771 - {{ name = 'path' }}, 772 - {{ name = 'cmdline' }, { name = 'cmdline_history' }} 773 - ), 774 739 }) 775 740 776 741 -- gitsigns