diff --git a/README.md b/README.md index f4f3924..a692b95 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ -# neovim.nix +# chainix Nix(OS) library and modules for building custom Neovim derivations and distributing them as flakes. ## Examples - [./example](./example/flake.nix) -- [nekowinston/neovim.drv](https://github.com/nekowinston/neovim.drv) -- [willruggiano/neovim.drv](https://github.com/willruggiano/neovim.drv) diff --git a/_sources/generated.json b/_sources/generated.json new file mode 100644 index 0000000..7450611 --- /dev/null +++ b/_sources/generated.json @@ -0,0 +1,506 @@ +{ + "base46": { + "cargoLocks": null, + "date": "2024-01-18", + "extract": null, + "name": "base46", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "comfysage", + "repo": "base46", + "rev": "ea004cd1031bc8dd7b5fdefe4da7a95920abc4da", + "sha256": "sha256-Eu/+jxM2tJKoI8CU1pUix3wFM4aMoEzz9jqkWYL51Cw=", + "sparseCheckout": [], + "type": "github" + }, + "version": "ea004cd1031bc8dd7b5fdefe4da7a95920abc4da" + }, + "chaivim": { + "cargoLocks": null, + "date": "2024-06-17", + "extract": null, + "name": "chaivim", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "comfysage", + "repo": "chaivim", + "rev": "dfd12ca616c630d4d6db14732b207442c889be32", + "sha256": "sha256-mI4YT/WEx0+b6SOKuOzTpTanZQsra5o2/pdb6OpVyc8=", + "sparseCheckout": [], + "type": "github" + }, + "version": "dfd12ca616c630d4d6db14732b207442c889be32" + }, + "evergarden": { + "cargoLocks": null, + "date": "2024-06-11", + "extract": null, + "name": "evergarden", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "comfysage", + "repo": "evergarden", + "rev": "2bf81fda8da86fac55310255201728c49fe585bd", + "sha256": "sha256-oZIirTxFRRGn1f1jXOAZHi8ih4nQEgsTDVwYzWR2coM=", + "sparseCheckout": [], + "type": "github" + }, + "version": "2bf81fda8da86fac55310255201728c49fe585bd" + }, + "fidget": { + "cargoLocks": null, + "date": "2024-05-19", + "extract": null, + "name": "fidget", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "j-hui", + "repo": "fidget.nvim", + "rev": "ef99df04a1c53a453602421bc0f756997edc8289", + "sha256": "sha256-Gpk/G0ByOAIE8uX4Xr94CvAjJBSJMEOwBuvrhmYYGsg=", + "sparseCheckout": [], + "type": "github" + }, + "version": "ef99df04a1c53a453602421bc0f756997edc8289" + }, + "gitsigns": { + "cargoLocks": null, + "date": "2024-06-18", + "extract": null, + "name": "gitsigns", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "lewis6991", + "repo": "gitsigns.nvim", + "rev": "f846c507242a74d9a458bff2d029bd2eae8c0ca1", + "sha256": "sha256-X6lWjwgzHeuiCmp+t2TFZFspUyKa7ioMvRsVvZjqayQ=", + "sparseCheckout": [], + "type": "github" + }, + "version": "f846c507242a74d9a458bff2d029bd2eae8c0ca1" + }, + "incline": { + "cargoLocks": null, + "date": "2024-05-16", + "extract": null, + "name": "incline", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "b0o", + "repo": "incline.nvim", + "rev": "16fc9c073e3ea4175b66ad94375df6d73fc114c0", + "sha256": "sha256-5DoIvIdAZV7ZgmQO2XmbM3G+nNn4tAumsShoN3rDGrs=", + "sparseCheckout": [], + "type": "github" + }, + "version": "16fc9c073e3ea4175b66ad94375df6d73fc114c0" + }, + "indent": { + "cargoLocks": null, + "date": "2024-05-23", + "extract": null, + "name": "indent", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "lukas-reineke", + "repo": "indent-blankline.nvim", + "rev": "d98f537c3492e87b6dc6c2e3f66ac517528f406f", + "sha256": "sha256-K5y0UQAXc0N6+1kqncX2eClpvZb7jlg7GhSerHQVZX0=", + "sparseCheckout": [], + "type": "github" + }, + "version": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" + }, + "keymaps": { + "cargoLocks": null, + "date": "2024-03-12", + "extract": null, + "name": "keymaps", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "comfysage", + "repo": "keymaps.nvim", + "rev": "62f10ae89dfcf065035c20ad3cda2c84f36e43ab", + "sha256": "sha256-Wgh9uVmKtKOCwo+Z3IFTp6Bv0m4QIju3FVPlxsHRWBg=", + "sparseCheckout": [], + "type": "github" + }, + "version": "62f10ae89dfcf065035c20ad3cda2c84f36e43ab" + }, + "lazy.nvim": { + "cargoLocks": null, + "date": "2024-06-17", + "extract": null, + "name": "lazy.nvim", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "folke", + "repo": "lazy.nvim", + "rev": "cd6a8293430a7fadf6a093dfdfbdb1ddbaf8ae7d", + "sha256": "sha256-/qP5YC2ylwQ8DKQR/G9cqah33/AhcrFCMyiHCNFsDGE=", + "sparseCheckout": [], + "type": "github" + }, + "version": "cd6a8293430a7fadf6a093dfdfbdb1ddbaf8ae7d" + }, + "lspconfig": { + "cargoLocks": null, + "date": "2024-06-15", + "extract": null, + "name": "lspconfig", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "neovim", + "repo": "nvim-lspconfig", + "rev": "bd7c76375a511994c9ca8d69441f134dc10ae3bd", + "sha256": "sha256-BNU8ihRktpGhSyp2ZYiG5h7uZ+uIf4EdPS/iIuo/NdM=", + "sparseCheckout": [], + "type": "github" + }, + "version": "bd7c76375a511994c9ca8d69441f134dc10ae3bd" + }, + "lualine": { + "cargoLocks": null, + "date": "2024-04-05", + "extract": null, + "name": "lualine", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "nvim-lualine", + "repo": "lualine.nvim", + "rev": "0a5a66803c7407767b799067986b4dc3036e1983", + "sha256": "sha256-WcH2dWdRDgMkwBQhcgT+Z/ArMdm+VbRhmQftx4t2kNI=", + "sparseCheckout": [], + "type": "github" + }, + "version": "0a5a66803c7407767b799067986b4dc3036e1983" + }, + "luasnip": { + "cargoLocks": null, + "date": "2024-06-07", + "extract": null, + "name": "luasnip", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "L3MON4D3", + "repo": "LuaSnip", + "rev": "50fcf17db7c75af80e6b6109acfbfb4504768780", + "sha256": "sha256-QgK/tI4KU+ZrVl7NFCP8lX7LWjes1pKvt2Eti/UZna8=", + "sparseCheckout": [], + "type": "github" + }, + "version": "50fcf17db7c75af80e6b6109acfbfb4504768780" + }, + "mini": { + "cargoLocks": null, + "date": "2024-06-14", + "extract": null, + "name": "mini", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "echasnovski", + "repo": "mini.nvim", + "rev": "ebc8cb0c1f73ee6c53e0560957a37a2307a70f98", + "sha256": "sha256-zgJ2AnLhNvPouj4BXFbi5Hp5W0CJ2sYLDBXZ6pLGeUs=", + "sparseCheckout": [], + "type": "github" + }, + "version": "ebc8cb0c1f73ee6c53e0560957a37a2307a70f98" + }, + "null": { + "cargoLocks": null, + "date": "2024-06-14", + "extract": null, + "name": "null", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "nvimtools", + "repo": "none-ls.nvim", + "rev": "cc0a3c45047e3daf85d07c1571d65476cfce6480", + "sha256": "sha256-G1t4q62hqwPrXXg/JUHw2nnepPicsY1gQ3BVnjNrQqk=", + "sparseCheckout": [], + "type": "github" + }, + "version": "cc0a3c45047e3daf85d07c1571d65476cfce6480" + }, + "nvim-cmp": { + "cargoLocks": null, + "date": "2024-06-08", + "extract": null, + "name": "nvim-cmp", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "hrsh7th", + "repo": "nvim-cmp", + "rev": "a110e12d0b58eefcf5b771f533fc2cf3050680ac", + "sha256": "sha256-7tEfEjWH5pneI10jLYpenoysRQPa2zPGLTNcbMX3x2I=", + "sparseCheckout": [], + "type": "github" + }, + "version": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" + }, + "plenary": { + "cargoLocks": null, + "date": "2024-05-20", + "extract": null, + "name": "plenary", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "nvim-lua", + "repo": "plenary.nvim", + "rev": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683", + "sha256": "sha256-5Jf2mWFVDofXBcXLbMa417mqlEPWLA+cQIZH/vNEV1g=", + "sparseCheckout": [], + "type": "github" + }, + "version": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" + }, + "telescope": { + "cargoLocks": null, + "date": "2024-06-15", + "extract": null, + "name": "telescope", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "nvim-telescope", + "repo": "telescope.nvim", + "rev": "c392f1b78eaaf870ca584bd698e78076ed301b26", + "sha256": "sha256-Hu/ETNN6Zy6kezTS5B/Z/bLp0Gjo0ehA0XmiBmb6YJI=", + "sparseCheckout": [], + "type": "github" + }, + "version": "c392f1b78eaaf870ca584bd698e78076ed301b26" + }, + "telescope_fzf": { + "cargoLocks": null, + "date": "2024-03-05", + "extract": null, + "name": "telescope_fzf", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "nvim-telescope", + "repo": "telescope-fzf-native.nvim", + "rev": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27", + "sha256": "sha256-rycebls3g0JCHM2+aG7xlJnX7ZPowqviaLbQrFSdflM=", + "sparseCheckout": [], + "type": "github" + }, + "version": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" + }, + "telescope_select": { + "cargoLocks": null, + "date": "2023-12-04", + "extract": null, + "name": "telescope_select", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "nvim-telescope", + "repo": "telescope-ui-select.nvim", + "rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2", + "sha256": "sha256-YRhNmmG4gx9Ht8JwjQfbTjJyTHEuZmtP6lqnhOsk8bE=", + "sparseCheckout": [], + "type": "github" + }, + "version": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" + }, + "todo_comments": { + "cargoLocks": null, + "date": "2024-06-12", + "extract": null, + "name": "todo_comments", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "folke", + "repo": "todo-comments.nvim", + "rev": "51e10f838e84b4756c16311d0b1ef0972c6482d2", + "sha256": "sha256-CcQjhccjUG5mEsPaNRR/doYKHw+HiVT/nhbk1kT5axo=", + "sparseCheckout": [], + "type": "github" + }, + "version": "51e10f838e84b4756c16311d0b1ef0972c6482d2" + }, + "treesitter": { + "cargoLocks": null, + "date": "2024-06-18", + "extract": null, + "name": "treesitter", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "nvim-treesitter", + "repo": "nvim-treesitter", + "rev": "2e9c346aefda680bd14ebf40a50c2897fd637bc2", + "sha256": "sha256-KSsA4d9J1nbJFEYfvCPHhkLZD4GgRkwkuql1d4v9ZKU=", + "sparseCheckout": [], + "type": "github" + }, + "version": "2e9c346aefda680bd14ebf40a50c2897fd637bc2" + }, + "trouble": { + "cargoLocks": null, + "date": "2024-06-14", + "extract": null, + "name": "trouble", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "folke", + "repo": "trouble.nvim", + "rev": "58a3acfc6d8d819324dab4c87068596319032e64", + "sha256": "sha256-GWl0MhQOvhTsRjw6dUx9a209z3ybRYM4bxWg79fRR28=", + "sparseCheckout": [], + "type": "github" + }, + "version": "58a3acfc6d8d819324dab4c87068596319032e64" + }, + "whichkey": { + "cargoLocks": null, + "date": "2024-06-07", + "extract": null, + "name": "whichkey", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "folke", + "repo": "which-key.nvim", + "rev": "0099511294f16b81c696004fa6a403b0ae61f7a0", + "sha256": "sha256-xfz51JQsEqaPRSzFw6DxM8yKFznOk9o9ETlZkErSzNg=", + "sparseCheckout": [], + "type": "github" + }, + "version": "0099511294f16b81c696004fa6a403b0ae61f7a0" + }, + "yosu": { + "cargoLocks": null, + "date": "2024-06-17", + "extract": null, + "name": "yosu", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "comfysage", + "repo": "yosu.nvim", + "rev": "553c8c526975c5107efde17950417f3738fbb72d", + "sha256": "sha256-bic9o81gkDLFV2K1HeSMg4xHofOzqebfvSqHl41XHps=", + "sparseCheckout": [], + "type": "github" + }, + "version": "553c8c526975c5107efde17950417f3738fbb72d" + } +} \ No newline at end of file diff --git a/_sources/generated.nix b/_sources/generated.nix new file mode 100644 index 0000000..2022c9d --- /dev/null +++ b/_sources/generated.nix @@ -0,0 +1,292 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: +{ + base46 = { + pname = "base46"; + version = "ea004cd1031bc8dd7b5fdefe4da7a95920abc4da"; + src = fetchFromGitHub { + owner = "comfysage"; + repo = "base46"; + rev = "ea004cd1031bc8dd7b5fdefe4da7a95920abc4da"; + fetchSubmodules = false; + sha256 = "sha256-Eu/+jxM2tJKoI8CU1pUix3wFM4aMoEzz9jqkWYL51Cw="; + }; + date = "2024-01-18"; + }; + chaivim = { + pname = "chaivim"; + version = "dfd12ca616c630d4d6db14732b207442c889be32"; + src = fetchFromGitHub { + owner = "comfysage"; + repo = "chaivim"; + rev = "dfd12ca616c630d4d6db14732b207442c889be32"; + fetchSubmodules = false; + sha256 = "sha256-mI4YT/WEx0+b6SOKuOzTpTanZQsra5o2/pdb6OpVyc8="; + }; + date = "2024-06-17"; + }; + evergarden = { + pname = "evergarden"; + version = "2bf81fda8da86fac55310255201728c49fe585bd"; + src = fetchFromGitHub { + owner = "comfysage"; + repo = "evergarden"; + rev = "2bf81fda8da86fac55310255201728c49fe585bd"; + fetchSubmodules = false; + sha256 = "sha256-oZIirTxFRRGn1f1jXOAZHi8ih4nQEgsTDVwYzWR2coM="; + }; + date = "2024-06-11"; + }; + fidget = { + pname = "fidget"; + version = "ef99df04a1c53a453602421bc0f756997edc8289"; + src = fetchFromGitHub { + owner = "j-hui"; + repo = "fidget.nvim"; + rev = "ef99df04a1c53a453602421bc0f756997edc8289"; + fetchSubmodules = false; + sha256 = "sha256-Gpk/G0ByOAIE8uX4Xr94CvAjJBSJMEOwBuvrhmYYGsg="; + }; + date = "2024-05-19"; + }; + gitsigns = { + pname = "gitsigns"; + version = "f846c507242a74d9a458bff2d029bd2eae8c0ca1"; + src = fetchFromGitHub { + owner = "lewis6991"; + repo = "gitsigns.nvim"; + rev = "f846c507242a74d9a458bff2d029bd2eae8c0ca1"; + fetchSubmodules = false; + sha256 = "sha256-X6lWjwgzHeuiCmp+t2TFZFspUyKa7ioMvRsVvZjqayQ="; + }; + date = "2024-06-18"; + }; + incline = { + pname = "incline"; + version = "16fc9c073e3ea4175b66ad94375df6d73fc114c0"; + src = fetchFromGitHub { + owner = "b0o"; + repo = "incline.nvim"; + rev = "16fc9c073e3ea4175b66ad94375df6d73fc114c0"; + fetchSubmodules = false; + sha256 = "sha256-5DoIvIdAZV7ZgmQO2XmbM3G+nNn4tAumsShoN3rDGrs="; + }; + date = "2024-05-16"; + }; + indent = { + pname = "indent"; + version = "d98f537c3492e87b6dc6c2e3f66ac517528f406f"; + src = fetchFromGitHub { + owner = "lukas-reineke"; + repo = "indent-blankline.nvim"; + rev = "d98f537c3492e87b6dc6c2e3f66ac517528f406f"; + fetchSubmodules = false; + sha256 = "sha256-K5y0UQAXc0N6+1kqncX2eClpvZb7jlg7GhSerHQVZX0="; + }; + date = "2024-05-23"; + }; + keymaps = { + pname = "keymaps"; + version = "62f10ae89dfcf065035c20ad3cda2c84f36e43ab"; + src = fetchFromGitHub { + owner = "comfysage"; + repo = "keymaps.nvim"; + rev = "62f10ae89dfcf065035c20ad3cda2c84f36e43ab"; + fetchSubmodules = false; + sha256 = "sha256-Wgh9uVmKtKOCwo+Z3IFTp6Bv0m4QIju3FVPlxsHRWBg="; + }; + date = "2024-03-12"; + }; + "lazy.nvim" = { + pname = "lazy.nvim"; + version = "cd6a8293430a7fadf6a093dfdfbdb1ddbaf8ae7d"; + src = fetchFromGitHub { + owner = "folke"; + repo = "lazy.nvim"; + rev = "cd6a8293430a7fadf6a093dfdfbdb1ddbaf8ae7d"; + fetchSubmodules = false; + sha256 = "sha256-/qP5YC2ylwQ8DKQR/G9cqah33/AhcrFCMyiHCNFsDGE="; + }; + date = "2024-06-17"; + }; + lspconfig = { + pname = "lspconfig"; + version = "bd7c76375a511994c9ca8d69441f134dc10ae3bd"; + src = fetchFromGitHub { + owner = "neovim"; + repo = "nvim-lspconfig"; + rev = "bd7c76375a511994c9ca8d69441f134dc10ae3bd"; + fetchSubmodules = false; + sha256 = "sha256-BNU8ihRktpGhSyp2ZYiG5h7uZ+uIf4EdPS/iIuo/NdM="; + }; + date = "2024-06-15"; + }; + lualine = { + pname = "lualine"; + version = "0a5a66803c7407767b799067986b4dc3036e1983"; + src = fetchFromGitHub { + owner = "nvim-lualine"; + repo = "lualine.nvim"; + rev = "0a5a66803c7407767b799067986b4dc3036e1983"; + fetchSubmodules = false; + sha256 = "sha256-WcH2dWdRDgMkwBQhcgT+Z/ArMdm+VbRhmQftx4t2kNI="; + }; + date = "2024-04-05"; + }; + luasnip = { + pname = "luasnip"; + version = "50fcf17db7c75af80e6b6109acfbfb4504768780"; + src = fetchFromGitHub { + owner = "L3MON4D3"; + repo = "LuaSnip"; + rev = "50fcf17db7c75af80e6b6109acfbfb4504768780"; + fetchSubmodules = false; + sha256 = "sha256-QgK/tI4KU+ZrVl7NFCP8lX7LWjes1pKvt2Eti/UZna8="; + }; + date = "2024-06-07"; + }; + mini = { + pname = "mini"; + version = "ebc8cb0c1f73ee6c53e0560957a37a2307a70f98"; + src = fetchFromGitHub { + owner = "echasnovski"; + repo = "mini.nvim"; + rev = "ebc8cb0c1f73ee6c53e0560957a37a2307a70f98"; + fetchSubmodules = false; + sha256 = "sha256-zgJ2AnLhNvPouj4BXFbi5Hp5W0CJ2sYLDBXZ6pLGeUs="; + }; + date = "2024-06-14"; + }; + null = { + pname = "null"; + version = "cc0a3c45047e3daf85d07c1571d65476cfce6480"; + src = fetchFromGitHub { + owner = "nvimtools"; + repo = "none-ls.nvim"; + rev = "cc0a3c45047e3daf85d07c1571d65476cfce6480"; + fetchSubmodules = false; + sha256 = "sha256-G1t4q62hqwPrXXg/JUHw2nnepPicsY1gQ3BVnjNrQqk="; + }; + date = "2024-06-14"; + }; + nvim-cmp = { + pname = "nvim-cmp"; + version = "a110e12d0b58eefcf5b771f533fc2cf3050680ac"; + src = fetchFromGitHub { + owner = "hrsh7th"; + repo = "nvim-cmp"; + rev = "a110e12d0b58eefcf5b771f533fc2cf3050680ac"; + fetchSubmodules = false; + sha256 = "sha256-7tEfEjWH5pneI10jLYpenoysRQPa2zPGLTNcbMX3x2I="; + }; + date = "2024-06-08"; + }; + plenary = { + pname = "plenary"; + version = "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683"; + src = fetchFromGitHub { + owner = "nvim-lua"; + repo = "plenary.nvim"; + rev = "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683"; + fetchSubmodules = false; + sha256 = "sha256-5Jf2mWFVDofXBcXLbMa417mqlEPWLA+cQIZH/vNEV1g="; + }; + date = "2024-05-20"; + }; + telescope = { + pname = "telescope"; + version = "c392f1b78eaaf870ca584bd698e78076ed301b26"; + src = fetchFromGitHub { + owner = "nvim-telescope"; + repo = "telescope.nvim"; + rev = "c392f1b78eaaf870ca584bd698e78076ed301b26"; + fetchSubmodules = false; + sha256 = "sha256-Hu/ETNN6Zy6kezTS5B/Z/bLp0Gjo0ehA0XmiBmb6YJI="; + }; + date = "2024-06-15"; + }; + telescope_fzf = { + pname = "telescope_fzf"; + version = "9ef21b2e6bb6ebeaf349a0781745549bbb870d27"; + src = fetchFromGitHub { + owner = "nvim-telescope"; + repo = "telescope-fzf-native.nvim"; + rev = "9ef21b2e6bb6ebeaf349a0781745549bbb870d27"; + fetchSubmodules = false; + sha256 = "sha256-rycebls3g0JCHM2+aG7xlJnX7ZPowqviaLbQrFSdflM="; + }; + date = "2024-03-05"; + }; + telescope_select = { + pname = "telescope_select"; + version = "6e51d7da30bd139a6950adf2a47fda6df9fa06d2"; + src = fetchFromGitHub { + owner = "nvim-telescope"; + repo = "telescope-ui-select.nvim"; + rev = "6e51d7da30bd139a6950adf2a47fda6df9fa06d2"; + fetchSubmodules = false; + sha256 = "sha256-YRhNmmG4gx9Ht8JwjQfbTjJyTHEuZmtP6lqnhOsk8bE="; + }; + date = "2023-12-04"; + }; + todo_comments = { + pname = "todo_comments"; + version = "51e10f838e84b4756c16311d0b1ef0972c6482d2"; + src = fetchFromGitHub { + owner = "folke"; + repo = "todo-comments.nvim"; + rev = "51e10f838e84b4756c16311d0b1ef0972c6482d2"; + fetchSubmodules = false; + sha256 = "sha256-CcQjhccjUG5mEsPaNRR/doYKHw+HiVT/nhbk1kT5axo="; + }; + date = "2024-06-12"; + }; + treesitter = { + pname = "treesitter"; + version = "2e9c346aefda680bd14ebf40a50c2897fd637bc2"; + src = fetchFromGitHub { + owner = "nvim-treesitter"; + repo = "nvim-treesitter"; + rev = "2e9c346aefda680bd14ebf40a50c2897fd637bc2"; + fetchSubmodules = false; + sha256 = "sha256-KSsA4d9J1nbJFEYfvCPHhkLZD4GgRkwkuql1d4v9ZKU="; + }; + date = "2024-06-18"; + }; + trouble = { + pname = "trouble"; + version = "58a3acfc6d8d819324dab4c87068596319032e64"; + src = fetchFromGitHub { + owner = "folke"; + repo = "trouble.nvim"; + rev = "58a3acfc6d8d819324dab4c87068596319032e64"; + fetchSubmodules = false; + sha256 = "sha256-GWl0MhQOvhTsRjw6dUx9a209z3ybRYM4bxWg79fRR28="; + }; + date = "2024-06-14"; + }; + whichkey = { + pname = "whichkey"; + version = "0099511294f16b81c696004fa6a403b0ae61f7a0"; + src = fetchFromGitHub { + owner = "folke"; + repo = "which-key.nvim"; + rev = "0099511294f16b81c696004fa6a403b0ae61f7a0"; + fetchSubmodules = false; + sha256 = "sha256-xfz51JQsEqaPRSzFw6DxM8yKFznOk9o9ETlZkErSzNg="; + }; + date = "2024-06-07"; + }; + yosu = { + pname = "yosu"; + version = "553c8c526975c5107efde17950417f3738fbb72d"; + src = fetchFromGitHub { + owner = "comfysage"; + repo = "yosu.nvim"; + rev = "553c8c526975c5107efde17950417f3738fbb72d"; + fetchSubmodules = false; + sha256 = "sha256-bic9o81gkDLFV2K1HeSMg4xHofOzqebfvSqHl41XHps="; + }; + date = "2024-06-17"; + }; +} diff --git a/docs/cpath.md b/docs/cpath.md deleted file mode 100644 index 2963d42..0000000 --- a/docs/cpath.md +++ /dev/null @@ -1,16 +0,0 @@ -# Plugins that require dynamic libraries - -(from [../example/flake.nix]) - -```nix -{ - neovim.lazy.plugins = { - lfs = let - package = pkgs.luajitPackages.luafilesystem; - in { - inherit package; - cpath = "${package}/lib/lua/5.1/?.so"; - }; - }; -} -``` diff --git a/docs/plugins.md b/docs/plugins.md deleted file mode 100644 index 12b9e5c..0000000 --- a/docs/plugins.md +++ /dev/null @@ -1,109 +0,0 @@ -# Defining plugins - -This library uses [lazy.nvim][lazy] under the hood to manage _loading_ plugins, -while nix is used (obviously) to source and build plugins. - -## Plugin specification - -The plugin specification file should be a nix function: - -```nix -{pkgs,...}: { - = ; -} -``` - -See [the pluginSpec](../modules/plugins/default.nix) for all options and their acceptable option types. - -For example: - -```nix -{pkgs,...}: let - # NOTE: Sources generated using niv - sources = import ./nix/sources.nix {}; -in { - lir = { - config = { - devicons = { - enable = true; - }; - }; - dependencies = { - nvim-web-devicons = { - src = sources.nvim-web-devicons; - config = ./devicons.lua; - }; - plenary = { - src = sources."plenary.nvim"; - }; - }; - src = sources."lir.nvim"; - }; -} -``` - -IMPORTANT: the name of each plugin (including dependencies) should be -the name of the Lua module. This has to do with how lazy.nvim works. - -NOTE: when running Neovim, all of the normal lazy.nvim user commands -will be available. Many of them will not work/won't be useful. This -includes commands related to installing or updating plugins, -`:Lazy install` and `:Lazy update` for example. Additionally, many -lazy commands require plugin directories to be git repositories, -`:Lazy check` for example. -These commands will not work either as the .git directories are -removed by nix during the packaging stage. - -This will result in a lazy.nvim plugin spec similar to the following: - -```lua -require("lazy").setup({ - { - name = "lir", - dir = "/nix/store/path/to/lir.nvim", - config = true, - opts = { - devicons = { - enable = true, - }, - }, - dependencies = { - { - name = "nvim-web-devicons", - dir = "/nix/store/path/to/nvim-web-devicons", - config = dofile "/nix/store/path/to/devicons.lua", - }, - { - name = "plenary", - dir = "/nix/store/path/to/plenary.nvim", - }, - }, - }, -}, {}) -``` - -NOTE: when passing paths and/or derivations as "config" and "init" options -for a plugin, the resulting nix store paths are `dofile`d into the lazy.nvim -spec. This means that whatever those files return should be a valid type -for lazy.nvim's "config" and "init" options! For example, the following might -be the contents of "devicons.lua" in the above example: - -```lua -return function() - require("nvim-web-devicons").setup { - override = { - lir_folder_icon = { - icon = ..., - color = ..., - name = "LirFolderNode", - }, - }, - } -end -``` - -## Plugins that require dynamic libraries (or luarocks) - -See [cpath.md](./cpath.md) - -[lazy]: https://github.com/folke/lazy.nvim diff --git a/example/flake.lock b/example/flake.lock index 6b120fb..7da7cfd 100644 --- a/example/flake.lock +++ b/example/flake.lock @@ -1,13 +1,50 @@ { "nodes": { + "chaivim": { + "inputs": { + "chaivim": "chaivim_2", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "pre-commit-nix": "pre-commit-nix" + }, + "locked": { + "lastModified": 1718636989, + "narHash": "sha256-GxrXVgTplZtvVupe2jxL3+7qSJ7HQhNQBUbYCrAsjzM=", + "owner": "isabelroses", + "repo": "chainix", + "rev": "d17e9f22c3d37dd29b8f1f956fdcb42585228e72", + "type": "github" + }, + "original": { + "owner": "isabelroses", + "repo": "chainix", + "type": "github" + } + }, + "chaivim_2": { + "flake": false, + "locked": { + "lastModified": 1718632878, + "narHash": "sha256-mI4YT/WEx0+b6SOKuOzTpTanZQsra5o2/pdb6OpVyc8=", + "owner": "comfysage", + "repo": "chaivim", + "rev": "dfd12ca616c630d4d6db14732b207442c889be32", + "type": "github" + }, + "original": { + "owner": "comfysage", + "repo": "chaivim", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -21,11 +58,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -39,11 +76,11 @@ "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -52,35 +89,20 @@ "type": "github" } }, - "flake-utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ - "neovim-nix", + "chaivim", "pre-commit-nix", "nixpkgs" ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -89,50 +111,13 @@ "type": "github" } }, - "lazy-nvim": { - "flake": false, - "locked": { - "lastModified": 1678889456, - "narHash": "sha256-R+sfPOuWfwbrNXUiKQcb8MHYqK+o5Pw8gkEaYaidqp0=", - "owner": "folke", - "repo": "lazy.nvim", - "rev": "6b55862d2d264f0b48e0b9e42cc2d14f136bed55", - "type": "github" - }, - "original": { - "owner": "folke", - "repo": "lazy.nvim", - "type": "github" - } - }, - "neovim-nix": { - "inputs": { - "flake-parts": "flake-parts_2", - "lazy-nvim": "lazy-nvim", - "nixpkgs": "nixpkgs", - "pre-commit-nix": "pre-commit-nix" - }, - "locked": { - "lastModified": 1710401652, - "narHash": "sha256-30WnQHknw7JHndn4/9S0ZtatHiXr5sofmRZkb43GH5Q=", - "owner": "willruggiano", - "repo": "neovim.nix", - "rev": "f73391e007bee33ac81896c47e9de5f5ef214eb6", - "type": "github" - }, - "original": { - "owner": "willruggiano", - "repo": "neovim.nix", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1706683685, - "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", + "lastModified": 1718428119, + "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", + "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", "type": "github" }, "original": { @@ -144,79 +129,67 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", - "type": "github" + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" } }, "nixpkgs-lib_2": { "locked": { - "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", - "type": "github" + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1673800717, - "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.11", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1671271357, - "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", + "lastModified": 1710765496, + "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "40f79f003b6377bd2f4ed4027dde1f8f922995dd", + "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_3": { "locked": { - "lastModified": 1710159071, - "narHash": "sha256-CT0WKgcmlcWZPZL/sSSICN/Vbm4Of0ZDgxc0GFf6sYU=", + "lastModified": 1718428119, + "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0fbcc4b2e8571f4af39be41752581ea09dd9ab06", + "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", "type": "github" }, "original": { @@ -229,17 +202,16 @@ "pre-commit-nix": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", "gitignore": "gitignore", "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1675169698, - "narHash": "sha256-C1wFiyJ+4SRvIsFkdMIN1Fa+58APmyTGKWpX9EKOehM=", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ce4efeec34c6eb35ba07b8fceaae87d6b46c1c5f", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { @@ -250,8 +222,8 @@ }, "root": { "inputs": { - "flake-parts": "flake-parts", - "neovim-nix": "neovim-nix", + "chaivim": "chaivim", + "flake-parts": "flake-parts_2", "nixpkgs": "nixpkgs_3" } } diff --git a/example/flake.nix b/example/flake.nix index dd543e8..1813b27 100644 --- a/example/flake.nix +++ b/example/flake.nix @@ -1,37 +1,23 @@ { - description = "Example usage of willruggiano/neovim.nix"; - inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - neovim-nix.url = "github:willruggiano/neovim.nix"; + chainix.url = "github:isabelroses/chainix"; }; outputs = { flake-parts, ... }@inputs: flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ inputs.neovim-nix.flakeModule ]; + imports = [ inputs.chainix.flakeModule ]; systems = [ "x86_64-linux" ]; perSystem = { config, pkgs, ... }: { neovim = { - env = { - BUILT_WITH_NEOVIM_NIX = "fuck yeah it is"; - }; paths = [ pkgs.stylua ]; - lazy = { - settings = { - performance.rtp = { - disabled_plugins = [ - "gzip" - "matchit" - "netrwPlugin" - ]; - }; - }; + chaivim = { plugins = { example = { src = ./example; diff --git a/example/spec/features_spec.lua b/example/spec/features_spec.lua index d647259..02df4c7 100644 --- a/example/spec/features_spec.lua +++ b/example/spec/features_spec.lua @@ -4,35 +4,6 @@ describe("neovim", function() end) it("(paths) adds to PATH", function() - assert.equal(1, vim.fn.executable "stylua") - end) - - describe("lazy", function() - it("(settings) disables builtin plugins", function() - assert.equal(0, vim.fn.exists "loaded_gzip") - assert.equal(0, vim.fn.exists "loaded_matchit") - assert.equal(0, vim.fn.exists "loaded_netrwPlugin") - end) - - describe("plugins", function() - local _, example = pcall(require, "example") - - it("() adds plugins", function() - assert.is_function(example.say_hello) - end) - - it("(dependencies) adds plugin dependencies", function() - assert.is_table(require "lfs") - assert.is_table(require "plenary") - end) - - it("(config) configures plugins", function() - assert.is_true(vim.g.loaded_example) - end) - - it("(paths) add plugin specific paths to PATH", function() - assert.equal(1, vim.fn.executable "luacheck") - end) - end) + assert.equal(1, vim.fn.executable("stylua")) end) end) diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 77c4018..0000000 --- a/flake.lock +++ /dev/null @@ -1,188 +0,0 @@ -{ - "nodes": { - "chaivim": { - "flake": false, - "locked": { - "lastModified": 1718632878, - "narHash": "sha256-mI4YT/WEx0+b6SOKuOzTpTanZQsra5o2/pdb6OpVyc8=", - "owner": "comfysage", - "repo": "chaivim", - "rev": "dfd12ca616c630d4d6db14732b207442c889be32", - "type": "github" - }, - "original": { - "owner": "comfysage", - "repo": "chaivim", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1706683685, - "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1673800717, - "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1671271357, - "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "40f79f003b6377bd2f4ed4027dde1f8f922995dd", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "pre-commit-nix": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "gitignore": "gitignore", - "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1675169698, - "narHash": "sha256-C1wFiyJ+4SRvIsFkdMIN1Fa+58APmyTGKWpX9EKOehM=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "ce4efeec34c6eb35ba07b8fceaae87d6b46c1c5f", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "root": { - "inputs": { - "chaivim": "chaivim", - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs", - "pre-commit-nix": "pre-commit-nix" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix index 9ce2878..1a6584e 100644 --- a/flake.nix +++ b/flake.nix @@ -4,38 +4,28 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - - chaivim = { - url = "github:comfysage/chaivim"; - flake = false; - }; - pre-commit-nix.url = "github:cachix/pre-commit-hooks.nix"; }; outputs = - { flake-parts, self, ... }@inputs: + { + self, + chaivim, + flake-parts, + ... + }@inputs: flake-parts.lib.mkFlake { inherit self inputs; } { imports = [ inputs.pre-commit-nix.flakeModule ]; - flake = { - flakeModule = { - imports = [ ./modules ]; - }; - }; + flake.flakeModule.imports = [ ./modules ]; systems = [ "aarch64-darwin" "x86_64-linux" ]; + perSystem = - { - config, - inputs', - pkgs, - system, - ... - }: + { pkgs, config, ... }: { apps = { check.program = pkgs.writeShellApplication { @@ -44,32 +34,30 @@ nix run ./example#test ''; }; + check-local.program = pkgs.writeShellApplication { name = "check-local"; text = '' - nix run --override-input neovim-nix path:./. ./example#test + nix run --override-input chainix path:./. ./example#test ''; }; }; devShells.default = pkgs.mkShell { name = "neovim.nix"; - shellHook = '' - ${config.pre-commit.installationScript} - ''; + shellHook = config.pre-commit.installationScript; }; formatter = pkgs.nixfmt-rfc-style; packages = { - utils = pkgs.callPackage ./utils.nix { }; + utils = pkgs.callPackage ./pkgs/utils.nix { }; + chaivim = pkgs.callPackage ./pkgs/chaivim.nix { }; }; - pre-commit = { - settings = { - hooks.nixfmt.enable = true; - hooks.stylua.enable = true; - }; + pre-commit.settings.hooks = { + nixfmt.enable = true; + stylua.enable = true; }; }; }; diff --git a/modules/default.nix b/modules/default.nix index f13016b..6246035 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -56,11 +56,13 @@ in default = { }; description = "Environment variables to bake into the final Neovim derivation's runtime"; }; + cpaths = mkOption { internal = true; type = listOf str; default = [ ]; }; + paths = mkOption { type = listOf package; default = [ ]; @@ -74,11 +76,7 @@ in }; }; - config = { - neovim = { - final = mkNeovimEnv { inherit config pkgs; }; - }; - }; + config.neovim.final = mkNeovimEnv { inherit config pkgs; }; } ); }; diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 9fa61f5..998412a 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -8,7 +8,7 @@ let pkgs.writeTextFile { name = "init.lua"; text = '' - -- Generated by Nix (via github:willruggiano/neovim.nix) + -- Generated by Nix vim.cmd.source "${config.neovim.build.before}" vim.cmd.source "${config.neovim.build.plugins}" ''; @@ -17,12 +17,7 @@ in { options = { perSystem = mkPerSystemOption ( - { - inputs', - config, - pkgs, - ... - }: + { pkgs, config, ... }: { options = with types; { neovim = { @@ -58,7 +53,6 @@ in before = pkgs.writeTextFile { name = "before.lua"; text = '' - -- Generated by Nix (via github:willruggiano/neovim.nix) vim.g.node_host_prog = "${env}/bin/neovim-node-host" vim.g.python3_host_prog = "${env}/bin/python" ''; diff --git a/modules/plugins/default.nix b/modules/plugins/default.nix index 40f6b22..8a34fef 100644 --- a/modules/plugins/default.nix +++ b/modules/plugins/default.nix @@ -2,24 +2,21 @@ with lib; let inherit (flake-parts-lib) mkPerSystemOption; + pluginSpec = with types; { options = { enabled = mkOption { - type = nullOr ( - oneOf [ - bool - str - ] - ); + type = nullOr (oneOf [ + bool + str + ]); default = null; }; src = mkOption { - type = nullOr ( - oneOf [ - attrs - path - ] - ); + type = nullOr (oneOf [ + attrs + path + ]); default = null; }; package = mkOption { @@ -43,25 +40,21 @@ let default = { }; }; init = mkOption { - type = nullOr ( - oneOf [ - package - path - str - ] - ); + type = nullOr (oneOf [ + package + path + str + ]); default = null; }; config = mkOption { - type = nullOr ( - oneOf [ - attrs - bool - package - path - str - ] - ); + type = nullOr (oneOf [ + attrs + bool + package + path + str + ]); default = null; }; opts = mkOption { @@ -69,30 +62,24 @@ let default = { }; }; event = mkOption { - type = nullOr ( - oneOf [ - str - (listOf str) - ] - ); + type = nullOr (oneOf [ + str + (listOf str) + ]); default = null; }; cmd = mkOption { - type = nullOr ( - oneOf [ - str - (listOf str) - ] - ); + type = nullOr (oneOf [ + str + (listOf str) + ]); default = null; }; ft = mkOption { - type = nullOr ( - oneOf [ - str - (listOf str) - ] - ); + type = nullOr (oneOf [ + str + (listOf str) + ]); default = null; }; keys = mkOption { @@ -122,58 +109,62 @@ in { options = { perSystem = mkPerSystemOption ( - { config, pkgs, ... }: + { pkgs, config, ... }: let - cfg = config.neovim.lazy; + cfg = config.neovim.chaivim; in { options = with types; { neovim = { - lazy = { + chaivim = { package = mkOption { type = package; - default = pkgs.vimPlugins.lazy-nvim; - }; - settings = mkOption { - type = submodule { - freeformType = attrsOf anything; - options = { - dev = { - path = mkOption { - type = nullOr ( - oneOf [ - path - str - ] - ); - default = null; - }; - }; - install = { - missing = mkOption { - type = bool; - default = false; - }; - }; - }; - }; + default = pkgs.callPackage ../../pkgs/chaivim.nix { }; }; + plugins = mkOption { type = attrsOf (submodule pluginSpec); default = { }; }; + + corePlugins = mkOption { + type = attrsOf (submodule pluginSpec); + default = + builtins.removeAttrs + (builtins.mapAttrs (_: val: { + inherit (val) src; + enabled = null; + package = null; + dev = null; + name = null; + lazy = null; + dependencies = { }; + init = null; + config = null; + opts = { }; + event = null; + cmd = null; + ft = null; + keys = null; + main = null; + priority = null; + paths = [ ]; + cpath = null; + }) (pkgs.callPackage ../../_sources/generated.nix { })) + [ + "override" + "overrideDerivation" + "chaivim" + ]; + }; }; build = { - lazy = { + chaivim = { spec = mkOption { type = str; internal = true; }; - opts = mkOption { - type = str; - internal = true; - }; }; plugins = mkOption { @@ -184,118 +175,118 @@ in }; }; - config = mkIf (cfg.plugins != [ ]) { - neovim = - let - mapPluginsRec = - fn: - mapAttrsToList (name: attrs: (fn name attrs) ++ (mapAttrsToList fn attrs.dependencies)) cfg.plugins; - in - { - build = - let - inherit (config.neovim) build; - inherit (pkgs.vimUtils) buildVimPlugin; + config = + let + allPlugins = cfg.plugins // cfg.corePlugins; + in + { + neovim = + let + mapPluginsRec = + fn: + mapAttrsToList (name: attrs: (fn name attrs) ++ (mapAttrsToList fn attrs.dependencies)) allPlugins; + in + { + build = + let + inherit (config.neovim) build; + inherit (pkgs.vimUtils) buildVimPlugin; - mkPlugin = - name: attrs: - if attrs.package != null then - attrs.package - else - buildVimPlugin { - inherit name; - inherit (attrs) src; - leaveDotGit = true; # So some lazy features (commands) work properly + mkPlugin = + name: attrs: + if attrs.package != null then + attrs.package + else + buildVimPlugin { + inherit name; + inherit (attrs) src; + leaveDotGit = true; # So some lazy features (commands) work properly + }; + in + { + chaivim = + let + toPlugin' = + name: attrs: + let + package = mkPlugin name attrs; + in + { + inherit name; + dir = "${package}"; + } + // optionalAttrs (isBool attrs.enabled) { inherit (attrs) enabled; } + // optionalAttrs (isString attrs.enabled) { enabled = lib.generators.mkLuaInline attrs.enabled; } + // optionalAttrs (isBool attrs.dev) { inherit (attrs) dev; } + // optionalAttrs (attrs.lazy != null) { inherit (attrs) lazy; } + // optionalAttrs (attrs.dependencies != { }) { + dependencies = + let + deps = mapAttrs toPlugin' attrs.dependencies; + in + attrValues deps; + } + // optionalAttrs (isDerivation attrs.init || isPath attrs.init) { + init = lib.generators.mkLuaInline ''dofile "${attrs.init}"''; + } + // optionalAttrs (isString attrs.init) { init = lib.generators.mkLuaInline attrs.init; } + // optionalAttrs (isBool attrs.config) { inherit (attrs) config; } + // optionalAttrs (isString attrs.config) { config = lib.generators.mkLuaInline attrs.config; } + // optionalAttrs (isDerivation attrs.config || isPath attrs.config) { + config = lib.generators.mkLuaInline ''dofile "${attrs.config}"''; + } + // optionalAttrs (isAttrs attrs.config) { + config = true; + opts = attrs.config; + } + // optionalAttrs (attrs.event != null) { inherit (attrs) event; } + // optionalAttrs (attrs.cmd != null) { inherit (attrs) cmd; } + // optionalAttrs (attrs.ft != null) { inherit (attrs) ft; } + // optionalAttrs (attrs.keys != null) { keys = lib.generators.mkLuaInline attrs.keys; } + // optionalAttrs (attrs.main != null) { inherit (attrs) main; } + // optionalAttrs (attrs.priority != null) { inherit (attrs) priority; }; + in + { + spec = lib.generators.toLua { } (mapAttrsToList toPlugin' allPlugins); }; - in - { - lazy = - let - toPlugin' = - name: attrs: - let - package = mkPlugin name attrs; - in + + plugins = + pkgs.runCommand "plugins.lua" { - inherit name; - dir = "${package}"; - } - // optionalAttrs (isBool attrs.enabled) { inherit (attrs) enabled; } - // optionalAttrs (isString attrs.enabled) { enabled = lib.generators.mkLuaInline attrs.enabled; } - // optionalAttrs (isBool attrs.dev) { inherit (attrs) dev; } - // optionalAttrs (attrs.lazy != null) { inherit (attrs) lazy; } - // optionalAttrs (attrs.dependencies != { }) { - dependencies = - let - deps = mapAttrs toPlugin' attrs.dependencies; - in - attrValues deps; - } - // optionalAttrs (isDerivation attrs.init || isPath attrs.init) { - init = lib.generators.mkLuaInline ''dofile "${attrs.init}"''; + nativeBuildInputs = with pkgs; [ stylua ]; + passAsFile = [ "text" ]; + preferLocalBuild = true; + allowSubstitutes = false; + text = '' + vim.opt.rtp:prepend "${cfg.package}" + require("core").setup({inputs = ${build.chaivim.spec}}, {core = {}}) + ''; } - // optionalAttrs (isString attrs.init) { init = lib.generators.mkLuaInline attrs.init; } - // optionalAttrs (isBool attrs.config) { inherit (attrs) config; } - // optionalAttrs (isString attrs.config) { config = lib.generators.mkLuaInline attrs.config; } - // optionalAttrs (isDerivation attrs.config || isPath attrs.config) { - config = lib.generators.mkLuaInline ''dofile "${attrs.config}"''; - } - // optionalAttrs (isAttrs attrs.config) { - config = true; - opts = attrs.config; - } - // optionalAttrs (attrs.event != null) { inherit (attrs) event; } - // optionalAttrs (attrs.cmd != null) { inherit (attrs) cmd; } - // optionalAttrs (attrs.ft != null) { inherit (attrs) ft; } - // optionalAttrs (attrs.keys != null) { keys = lib.generators.mkLuaInline attrs.keys; } - // optionalAttrs (attrs.main != null) { inherit (attrs) main; } - // optionalAttrs (attrs.priority != null) { inherit (attrs) priority; }; + '' + target=$out + mkdir -p "$(dirname "$target")" + if [ -e "$textPath" ]; then + mv "$textPath" "$target" + else + echo -n "$text" > "$target" + fi - spec = lib.generators.toLua { } (mapAttrsToList toPlugin' cfg.plugins); - opts = lib.generators.toLua { } ({ performance.rtp.reset = false; } // cfg.settings); - in - { - inherit spec opts; - }; - - plugins = - pkgs.runCommand "plugins.lua" - { - nativeBuildInputs = with pkgs; [ stylua ]; - passAsFile = [ "text" ]; - preferLocalBuild = true; - allowSubstitutes = false; - text = '' - -- Generated by Nix (via github:willruggiano/neovim.nix) - vim.opt.rtp:prepend "${cfg.package}" - require("lazy").setup(${build.lazy.spec}, ${build.lazy.opts}) + stylua --config-path ${../../stylua.toml} $target ''; - } - '' - target=$out - mkdir -p "$(dirname "$target")" - if [ -e "$textPath" ]; then - mv "$textPath" "$target" - else - echo -n "$text" > "$target" - fi - - stylua --config-path ${../../stylua.toml} $target - ''; - }; + }; - cpaths = - let - cpaths = mapPluginsRec (_: attrs: optional (attrs.cpath != null) attrs.cpath); - in - mkAfter (flatten cpaths); - paths = - let - paths = mapPluginsRec (_: attrs: attrs.paths); - in - mkAfter (flatten paths); - }; - }; + cpaths = + let + cpaths = mapPluginsRec (_: attrs: optional (attrs.cpath != null) attrs.cpath); + in + mkAfter (flatten cpaths); + paths = + let + paths = mapPluginsRec (_: attrs: attrs.paths); + in + mkAfter (flatten paths); + }; + }; } ); }; diff --git a/nvfetcher.toml b/nvfetcher.toml new file mode 100644 index 0000000..1fc5715 --- /dev/null +++ b/nvfetcher.toml @@ -0,0 +1,95 @@ +[chaivim] +fetch.github = 'comfysage/chaivim' +src.git = 'https://github.com/comfysage/chaivim' + +[keymaps] +fetch.github = 'comfysage/keymaps.nvim' +src.git = 'https://github.com/comfysage/keymaps.nvim' + +[yosu] +fetch.github = 'comfysage/yosu.nvim' +src.git = 'https://github.com/comfysage/yosu.nvim' + +[base46] +fetch.github = 'comfysage/base46' +src.git = 'https://github.com/comfysage/base46' + +[plenary] +fetch.github = 'nvim-lua/plenary.nvim' +src.git = 'https://github.com/nvim-lua/plenary.nvim' + +[telescope] +fetch.github = 'nvim-telescope/telescope.nvim' +src.git = 'https://github.com/nvim-telescope/telescope.nvim' + +[lualine] +fetch.github = 'nvim-lualine/lualine.nvim' +src.git = 'https://github.com/nvim-lualine/lualine.nvim' + +[evergarden] +fetch.github = 'comfysage/evergarden' +src.git = 'https://github.com/comfysage/evergarden' + +["lazy.nvim"] +fetch.github = 'folke/lazy.nvim' +src.git = 'https://github.com/folke/lazy.nvim' + +[treesitter] +fetch.github = 'nvim-treesitter/nvim-treesitter' +src.git = 'https://github.com/nvim-treesitter/nvim-treesitter' + +[nvim-cmp] +fetch.github = 'hrsh7th/nvim-cmp' +src.git = 'https://github.com/hrsh7th/nvim-cmp' + +[lspconfig] +fetch.github = 'neovim/nvim-lspconfig' +src.git = 'https://github.com/neovim/nvim-lspconfig' + +[luasnip] +fetch.github = 'L3MON4D3/LuaSnip' +src.git = 'https://github.com/L3MON4D3/LuaSnip' + +[null] +fetch.github = 'nvimtools/none-ls.nvim' +src.git = 'https://github.com/nvimtools/none-ls.nvim' + +[mini] +fetch.github = 'echasnovski/mini.nvim' +src.git = 'https://github.com/echasnovski/mini.nvim' + +[gitsigns] +fetch.github = 'lewis6991/gitsigns.nvim' +src.git = 'https://github.com/lewis6991/gitsigns.nvim' + +[telescope_fzf] +fetch.github = 'nvim-telescope/telescope-fzf-native.nvim' +src.git = 'https://github.com/nvim-telescope/telescope-fzf-native.nvim' + +[telescope_select] +fetch.github = 'nvim-telescope/telescope-ui-select.nvim' +src.git = 'https://github.com/nvim-telescope/telescope-ui-select.nvim' + +[whichkey] +fetch.github = 'folke/which-key.nvim' +src.git = 'https://github.com/folke/which-key.nvim' + +[todo_comments] +fetch.github = 'folke/todo-comments.nvim' +src.git = 'https://github.com/folke/todo-comments.nvim' + +[trouble] +fetch.github = 'folke/trouble.nvim' +src.git = 'https://github.com/folke/trouble.nvim' + +[incline] +fetch.github = 'b0o/incline.nvim' +src.git = 'https://github.com/b0o/incline.nvim' + +[indent] +fetch.github = 'lukas-reineke/indent-blankline.nvim' +src.git = 'https://github.com/lukas-reineke/indent-blankline.nvim' + +[fidget] +fetch.github = 'j-hui/fidget.nvim' +src.git = 'https://github.com/j-hui/fidget.nvim' diff --git a/pkgs/chaivim.nix b/pkgs/chaivim.nix new file mode 100644 index 0000000..2607f8f --- /dev/null +++ b/pkgs/chaivim.nix @@ -0,0 +1,8 @@ +{ vimUtils, callPackage }: +let + inherit ((callPackage ../_sources/generated.nix { }).chaivim) src; +in +vimUtils.buildVimPlugin { + name = "chaivim"; + inherit src; +} diff --git a/utils.nix b/pkgs/utils.nix similarity index 60% rename from utils.nix rename to pkgs/utils.nix index 964ec70..d7e540a 100644 --- a/utils.nix +++ b/pkgs/utils.nix @@ -23,18 +23,16 @@ stdenv.mkDerivation { originalLuaDrv: let inherit (luajitPackages) luarocksMoveDataFolder; - luaDrv = lualib.overrideLuarocks originalLuaDrv ( - drv: { - extraConfig = '' - lua_modules_path = "lua" - ''; - } - ); + luaDrv = lualib.overrideLuarocks originalLuaDrv (_: { + extraConfig = '' + lua_modules_path = "lua" + ''; + }); in vimUtils.toVimPlugin ( - luaDrv.overrideAttrs ( - oa: { nativeBuildInputs = oa.nativeBuildInputs ++ [ luarocksMoveDataFolder ]; } - ) + luaDrv.overrideAttrs (oa: { + nativeBuildInputs = oa.nativeBuildInputs ++ [ luarocksMoveDataFolder ]; + }) ); }; } diff --git a/stylua.toml b/stylua.toml index 364ef9c..5957975 100644 --- a/stylua.toml +++ b/stylua.toml @@ -1,3 +1,9 @@ indent_type = "Spaces" indent_width = 2 -no_call_parentheses = true +column_width = 120 +quote_style = "AutoPreferDouble" +call_parentheses = "Always" +line_endings = "Unix" + +[sort_requires] +enabled = true