From c2fb58fe7a18683edb750e20d9bb3e7992317ddb Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 17 Jun 2024 00:25:23 +0200 Subject: [PATCH] feat: initial implementation --- README.md | 146 ++- flake.lock | 1814 +++++++++++++++++++++++++++----- flake.nix | 33 +- lua/rocks-lazy/meta.lua | 32 + nix/overlay.nix | 89 +- plugin/rocks-lazy.lua | 74 ++ rocks-lazy.nvim-scm-1.rockspec | 2 +- 7 files changed, 1907 insertions(+), 283 deletions(-) create mode 100644 lua/rocks-lazy/meta.lua diff --git a/README.md b/README.md index 91f3900..59dd3e0 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ ## :star2: Summary `rocks-lazy.nvim` is a rocks.nvim module that helps you lazy-load -your `opt` rocks.nvim plugins. +your `opt` rocks.nvim plugins +using the [`lz.n`](https://github.com/nvim-neorocks/lz.n) library. > [!NOTE] > @@ -62,7 +63,148 @@ and you are good to go! ## :books: Usage -- [ ] TODO +With this module installed, you can add the following fields to a `[plugins]` entry +in your `rocks.toml`: + +### Fields + +#### `event` + +Lazy-load on an event (`:h autocmd-events`). + +- Type: `string?` or `string[]` + +Events can be specified with or without patterns, e.g. +`BufEnter` or `BufEnter *.lua`. + +Example: + +```toml +[plugins.nvim-cmp] +version = "scm" +opt = true +event = "InsertEnter" +``` + +```toml +[plugins] +nvim-cmp = { version = "scm", opt = true, event = "InsertEnter" } +``` + +#### `cmd` + +Lazy-load on a command (`:h user-commands`). + +- Type: `string?` or `string[]` + +Example: + +```toml +[plugins."telescope.nvim"] +version = "0.1.8" +opt = true +cmd = "Telescope" +``` + +```toml +[plugins] +"telescope.nvim" = { version = "0.1.8", opt = true, cmd = "Telescope" } +``` + +#### `ft` + +Lazy-load on a `:h filetype` event. + +- Type: `string?` or `string[]` + +Example: + +```toml +[plugins.neorg] +version = "8.0.0" +opt = true +ft = "norg" +``` + +```toml +[plugins] +neorg = { version = "8.0.0", opt = true, ft = "norg" } +``` + +#### `keys` + +Lazy-load on key mappings. + +- Type: `string?` or `string[]` or `rocks.lazy.KeysSpec[]` + +Where `rocks.lazy.KeysSpec` is a table with the following fields: + +- `lhs`: `string` +- `rhs`: `string?` +- `mode`: `string?` or `string[]` (default: `"n"`) +- `[string]`: Options, see `:h vim.keymap.set` + +> [!NOTE] +> +> If unspecified, the default `mode` is `n`. + +Examples: + +```toml +[plugins."neo-tree.nvim"] +version = "scm" +opt = true +keys = { lhs = "ft", rhs = "Neotree toggle", desc = "NeoTree toggle" } + +[plugins."dial.nvim"] +version = "0.4.0" +opt = true +keys = ["", { lhs = "", mode = "n" }] +``` + +```toml +[plugins] +"neo-tree.nvim" = { version = "scm", opt = true, keys = { "ft", "Neotree toggle", desc = "NeoTree toggle" } } +``` + +#### `colorscheme` + +Lazy-load when setting a colorscheme. + +- Type: `string?` or `string[]` + +Example: + +```toml +[plugins."kanagawa.nvim"] +version = "1.0.0" +opt = true +colorscheme = [ + "kanagawa", + "kanagawa-dragon", + "kanagawa-lotus", + "kanagawa-wave" +] +``` + +```toml +[plugins] +"sweetie.nvim" = { version = "1.0.0", opt = true, colorscheme = "sweetie" } +``` + +> [!TIP] +> +> You can specify combinations of the above lazy-loading fields +> +> Example: +> +> ```toml +> [plugins."telescope.nvim"] +> version = "0.1.8" +> opt = true +> cmd = "Telescope" +> keys = [ { lhs = "t", rhs = "Telescope" } ] +> ``` ## :book: License diff --git a/flake.lock b/flake.lock index eeebfee..d49a5da 100644 --- a/flake.lock +++ b/flake.lock @@ -16,261 +16,1541 @@ "type": "github" } }, + "flake-compat_10": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_11": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_12": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_13": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_14": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_15": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_6": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_7": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_8": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_9": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_10": { + "inputs": { + "nixpkgs-lib": [ + "neorocks", + "neovim-nightly", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_11": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_7" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_12": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_8" + }, + "locked": { + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_13": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_9" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_14": { + "inputs": { + "nixpkgs-lib": [ + "rocks-nvim-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_15": { + "inputs": { + "nixpkgs-lib": [ + "rocks-nvim-flake", + "neorocks", + "neovim-nightly", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_4" + }, + "locked": { + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_5" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_6": { + "inputs": { + "nixpkgs-lib": [ + "lz-n-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_7": { + "inputs": { + "nixpkgs-lib": [ + "lz-n-flake", + "neorocks", + "neovim-nightly", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_8": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_6" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_9": { + "inputs": { + "nixpkgs-lib": [ + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "gen-luarc": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1717108591, + "narHash": "sha256-Sn6jrh9Nqp5UKJzNT0rg/DQCJCpFs/d+RM2/iENPpBo=", + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "rev": "39704e58b5227a82a14a00f5912e4bfccfa2b687", + "type": "github" + }, + "original": { + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "type": "github" + } + }, + "gen-luarc_2": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1717108591, + "narHash": "sha256-Sn6jrh9Nqp5UKJzNT0rg/DQCJCpFs/d+RM2/iENPpBo=", + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "rev": "39704e58b5227a82a14a00f5912e4bfccfa2b687", + "type": "github" + }, + "original": { + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "type": "github" + } + }, + "gen-luarc_3": { + "inputs": { + "flake-parts": "flake-parts_12", + "nixpkgs": "nixpkgs_12" + }, + "locked": { + "lastModified": 1717108591, + "narHash": "sha256-Sn6jrh9Nqp5UKJzNT0rg/DQCJCpFs/d+RM2/iENPpBo=", + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "rev": "39704e58b5227a82a14a00f5912e4bfccfa2b687", + "type": "github" + }, + "original": { + "owner": "mrcjkb", + "repo": "nix-gen-luarc-json", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_3", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_4", + "gitignore": "gitignore_2", + "nixpkgs": [ + "lz-n-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ], + "nixpkgs-stable": [ + "lz-n-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_3": { + "inputs": { + "flake-compat": "flake-compat_7", + "gitignore": "gitignore_4", + "nixpkgs": "nixpkgs_8", + "nixpkgs-stable": "nixpkgs-stable_3" + }, + "locked": { + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_4": { + "inputs": { + "flake-compat": "flake-compat_9", + "gitignore": "gitignore_5", + "nixpkgs": [ + "neorocks", + "neovim-nightly", + "nixpkgs" + ], + "nixpkgs-stable": [ + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_5": { + "inputs": { + "flake-compat": "flake-compat_12", + "gitignore": "gitignore_7", + "nixpkgs": "nixpkgs_13", + "nixpkgs-stable": "nixpkgs-stable_5" + }, + "locked": { + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_6": { + "inputs": { + "flake-compat": "flake-compat_14", + "gitignore": "gitignore_8", + "nixpkgs": [ + "rocks-nvim-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ], + "nixpkgs-stable": [ + "rocks-nvim-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "lz-n-flake", + "neorocks", + "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_2": { + "inputs": { + "nixpkgs": [ + "lz-n-flake", + "neorocks", + "neovim-nightly", + "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": [ + "lz-n-flake", + "pre-commit-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_4": { + "inputs": { + "nixpkgs": [ + "neorocks", + "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_5": { + "inputs": { + "nixpkgs": [ + "neorocks", + "neovim-nightly", + "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_6": { + "inputs": { + "nixpkgs": [ + "pre-commit-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_7": { + "inputs": { + "nixpkgs": [ + "rocks-nvim-flake", + "neorocks", + "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_8": { + "inputs": { + "nixpkgs": [ + "rocks-nvim-flake", + "neorocks", + "neovim-nightly", + "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_9": { + "inputs": { + "nixpkgs": [ + "rocks-nvim-flake", + "pre-commit-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" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_7", + "nixpkgs": [ + "lz-n-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713898448, + "narHash": "sha256-6q6ojsp/Z9P2goqnxyfCSzFOD92T3Uobmj8oVAicUOs=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "c0302ec12d569532a6b6bd218f698bc402e93adc", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "hercules-ci-effects_2": { + "inputs": { + "flake-parts": "flake-parts_10", + "nixpkgs": [ + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1718018037, + "narHash": "sha256-03rLBd/lKecgaKz0j5ESUf9lDn5R0SJatZTKLL5unWE=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "hercules-ci-effects_3": { + "inputs": { + "flake-parts": "flake-parts_15", + "nixpkgs": [ + "rocks-nvim-flake", + "neorocks", + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1718018037, + "narHash": "sha256-03rLBd/lKecgaKz0j5ESUf9lDn5R0SJatZTKLL5unWE=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "0ab08b23ce3c3f75fe9a5598756b6fb8bcf0b414", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "lz-n-flake": { + "inputs": { + "flake-parts": "flake-parts_3", + "gen-luarc": "gen-luarc_2", + "neorocks": "neorocks", + "nixpkgs": "nixpkgs_6", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1718570430, + "narHash": "sha256-IEtaPGWEervR2PhU5PNMTb+Kae4Eua+oZyBNsgj7Y94=", + "owner": "nvim-neorocks", + "repo": "lz.n", + "rev": "106391ffa09d07d96ce554146bf94b039341dcff", + "type": "github" + }, + "original": { + "owner": "nvim-neorocks", + "repo": "lz.n", + "type": "github" + } + }, + "neorocks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts_5", + "git-hooks": "git-hooks", + "neovim-nightly": "neovim-nightly", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1717565085, + "narHash": "sha256-4d7VaRRjKGbFkam+65fb8Qll6lu/3NURfrngqjgJeCo=", + "owner": "nvim-neorocks", + "repo": "neorocks", + "rev": "cd9580a8997a5b7a9d5b009ee40c739c1512574d", + "type": "github" + }, + "original": { + "owner": "nvim-neorocks", + "repo": "neorocks", + "type": "github" + } + }, + "neorocks_2": { + "inputs": { + "flake-compat": "flake-compat_6", + "flake-parts": "flake-parts_8", + "git-hooks": "git-hooks_3", + "neovim-nightly": "neovim-nightly_2", + "nixpkgs": "nixpkgs_10" + }, + "locked": { + "lastModified": 1718515557, + "narHash": "sha256-CTcyT22FKLgnD/2V3Tp0vqwgvAYJnbl/1KtYNoXcYMw=", + "owner": "nvim-neorocks", + "repo": "neorocks", + "rev": "cef907394d9f4ea22dd7ed87f5c1db73b6744afa", + "type": "github" + }, + "original": { + "owner": "nvim-neorocks", + "repo": "neorocks", + "type": "github" + } + }, + "neorocks_3": { + "inputs": { + "flake-compat": "flake-compat_11", + "flake-parts": "flake-parts_13", + "git-hooks": "git-hooks_5", + "neovim-nightly": "neovim-nightly_3", + "nixpkgs": "nixpkgs_15" + }, + "locked": { + "lastModified": 1718429358, + "narHash": "sha256-jxakPQ80m676p64PRYOflfOCzUvLABzNTDJpm0UtSZ8=", + "owner": "nvim-neorocks", + "repo": "neorocks", + "rev": "e29769565e5ef77415d47fb6b7f0e74e17771d0d", + "type": "github" + }, + "original": { + "owner": "nvim-neorocks", + "repo": "neorocks", + "type": "github" + } + }, + "neovim-nightly": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts_6", + "git-hooks": "git-hooks_2", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-src": "neovim-src", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1717559432, + "narHash": "sha256-UkjZp5LfrWKxidGzZLRqHs3H4/u6FQAc5yS5QsLKndw=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "52dd6362442d42dfc0d2f7c0176690d64ba4fc6d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-nightly_2": { + "inputs": { + "flake-compat": "flake-compat_8", + "flake-parts": "flake-parts_9", + "git-hooks": "git-hooks_4", + "hercules-ci-effects": "hercules-ci-effects_2", + "neovim-src": "neovim-src_2", + "nixpkgs": "nixpkgs_9" + }, + "locked": { + "lastModified": 1718512978, + "narHash": "sha256-roENt8tYPxBXcaluvburPG9PeKhr4BgoYup2LR66wvA=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "c1e57fe1d1172672adae8633286d5d7713309ccf", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-nightly_3": { + "inputs": { + "flake-compat": "flake-compat_13", + "flake-parts": "flake-parts_14", + "git-hooks": "git-hooks_6", + "hercules-ci-effects": "hercules-ci-effects_3", + "neovim-src": "neovim-src_3", + "nixpkgs": "nixpkgs_14" + }, + "locked": { + "lastModified": 1718424280, + "narHash": "sha256-Y1Bjk8e9KJQ+5gwxNcRSz4l6k0yDLQ28MZ9qoeEeCII=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "450744cea2778415ff8c23553d37048d01df6c5b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1717536944, + "narHash": "sha256-JzJ3xxXmI8732nl3p2Zg/qZiaLTVEWZ8pn3PfsGnvxs=", + "owner": "neovim", + "repo": "neovim", + "rev": "f69937fdbd162630c35e119e67bbbf052558c0e0", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "neovim-src_2": { + "flake": false, + "locked": { + "lastModified": 1718492826, + "narHash": "sha256-YaZyuhBSZFnwoMwe790NjzUyff/Ml93jJ6wxj4dCFdc=", + "owner": "neovim", + "repo": "neovim", + "rev": "aa319da4024a77b0f7c40e08c6f5d5b512a7f899", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "neovim-src_3": { + "flake": false, + "locked": { + "lastModified": 1718407238, + "narHash": "sha256-eJ0qrdEWH7WRwLTBIXIOYB/DvBHvgvm6x4bBonkzXLQ=", + "owner": "neovim", + "repo": "neovim", + "rev": "199d852d9f8584217be38efb56b725aa3db62931", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716948383, + "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + } + }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + } + }, + "nixpkgs-lib_3": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + } + }, + "nixpkgs-lib_4": { + "locked": { + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + } + }, + "nixpkgs-lib_5": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + } + }, + "nixpkgs-lib_6": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + } + }, + "nixpkgs-lib_7": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" }, "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" } }, - "flake-compat_3": { - "flake": false, + "nixpkgs-lib_8": { "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" }, "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" } }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib_9": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + } + }, + "nixpkgs-stable": { "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", "type": "github" } }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib_2" - }, + "nixpkgs-stable_2": { "locked": { - "lastModified": 1706830856, - "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, + "nixpkgs-stable_3": { "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, + "nixpkgs-stable_4": { "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", "type": "github" } }, - "flake-utils_3": { - "inputs": { - "systems": "systems_3" - }, + "nixpkgs-stable_5": { "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", "type": "github" } }, - "flake-utils_4": { - "inputs": { - "systems": "systems_4" - }, + "nixpkgs-stable_6": { "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", "type": "github" } }, - "gen-luarc": { - "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs" - }, + "nixpkgs_10": { "locked": { - "lastModified": 1708688915, - "narHash": "sha256-Vcfbdo2IOEiimRnehGLUM5l2VEIjZYZdKS0sjYWwfb4=", - "owner": "mrcjkb", - "repo": "nix-gen-luarc-json", - "rev": "6eb62734dae84e5f79368dfc545b3fff305df754", + "lastModified": 1718276985, + "narHash": "sha256-u1fA0DYQYdeG+5kDm1bOoGcHtX0rtC7qs2YA2N1X++I=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3f84a279f1a6290ce154c5531378acc827836fbb", "type": "github" }, "original": { - "owner": "mrcjkb", - "repo": "nix-gen-luarc-json", + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "neorocks", - "pre-commit-hooks", - "nixpkgs" - ] - }, + "nixpkgs_11": { "locked": { - "lastModified": 1703887061, - "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "lastModified": 1718575248, + "narHash": "sha256-9elZuSCty25Jr6m5yZNpYwmagYW8JIWxeZ36vKlPAvo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b96d99b63d7fa5249643061378087b0c75a70390", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", + "owner": "nixos", + "repo": "nixpkgs", "type": "github" } }, - "gitignore_2": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks", - "nixpkgs" - ] - }, + "nixpkgs_12": { "locked": { - "lastModified": 1703887061, - "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "lastModified": 1716948383, + "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", "type": "github" } }, - "neorocks": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "neovim-nightly": "neovim-nightly", - "nixpkgs": "nixpkgs_2", - "pre-commit-hooks": "pre-commit-hooks" - }, + "nixpkgs_13": { "locked": { - "lastModified": 1710393710, - "narHash": "sha256-ZbX8liGXk4iWmxTEnyuWFI2LNs+CYoRAelpvnoyt7mc=", - "owner": "nvim-neorocks", - "repo": "neorocks", - "rev": "5f5137a6180b1d52ec522f850a57ae53af9f8677", + "lastModified": 1710765496, + "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", "type": "github" }, "original": { - "owner": "nvim-neorocks", - "repo": "neorocks", + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, - "neovim-nightly": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "neorocks", - "nixpkgs" - ] + "nixpkgs_14": { + "locked": { + "lastModified": 1718276985, + "narHash": "sha256-u1fA0DYQYdeG+5kDm1bOoGcHtX0rtC7qs2YA2N1X++I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3f84a279f1a6290ce154c5531378acc827836fbb", + "type": "github" }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_15": { "locked": { - "dir": "contrib", - "lastModified": 1710391217, - "narHash": "sha256-Wm0SSQ6HJY1IUGkhFgD0LtJGw6lppxMuKgLI94Dr1yk=", - "owner": "neovim", - "repo": "neovim", - "rev": "3502aa63f0f4ea8d8982aea81a819424e71029bc", + "lastModified": 1718276985, + "narHash": "sha256-u1fA0DYQYdeG+5kDm1bOoGcHtX0rtC7qs2YA2N1X++I=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3f84a279f1a6290ce154c5531378acc827836fbb", "type": "github" }, "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, - "nixpkgs": { + "nixpkgs_2": { "locked": { - "lastModified": 1708475490, - "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", + "lastModified": 1716948383, + "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0e74ca98a74bc7270d28838369593635a5db3260", + "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", "type": "github" }, "original": { @@ -280,122 +1560,131 @@ "type": "github" } }, - "nixpkgs-lib": { + "nixpkgs_3": { "locked": { - "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", + "lastModified": 1710765496, + "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", "type": "github" }, "original": { - "dir": "lib", "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-lib_2": { + "nixpkgs_4": { "locked": { - "dir": "lib", - "lastModified": 1706550542, - "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "lastModified": 1717399147, + "narHash": "sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "rev": "4a4ecb0ab415c9fccfb005567a215e6a9564cdf5", "type": "github" }, "original": { - "dir": "lib", "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-stable": { + "nixpkgs_5": { "locked": { - "lastModified": 1704874635, - "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", - "owner": "NixOS", + "lastModified": 1717399147, + "narHash": "sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "rev": "4a4ecb0ab415c9fccfb005567a215e6a9564cdf5", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-23.11", + "owner": "nixos", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-stable_2": { + "nixpkgs_6": { + "locked": { + "lastModified": 1717399147, + "narHash": "sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4a4ecb0ab415c9fccfb005567a215e6a9564cdf5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { "locked": { - "lastModified": 1704874635, - "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", + "lastModified": 1710765496, + "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_8": { "locked": { - "lastModified": 1710346304, - "narHash": "sha256-vwoyBoCovK7+vdbCYqL9MssoFQjaXtZN8sElcjUdbx8=", - "owner": "nixos", + "lastModified": 1710765496, + "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "a0906f14161a5c5792e9883117b9471f5bf6df72", + "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_9": { "locked": { - "lastModified": 1710420109, - "narHash": "sha256-UkHXDP357wXlols1mGnoI2zzuy9Sv7YvD3/gq/CZ6mM=", - "owner": "nixos", + "lastModified": 1718276985, + "narHash": "sha256-u1fA0DYQYdeG+5kDm1bOoGcHtX0rtC7qs2YA2N1X++I=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "5c43596de143e0403a1821e2ee9d041c5cf017e5", + "rev": "3f84a279f1a6290ce154c5531378acc827836fbb", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", - "gitignore": "gitignore", - "nixpkgs": [ - "neorocks", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" + "flake-compat": "flake-compat_5", + "gitignore": "gitignore_3", + "nixpkgs": "nixpkgs_7", + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1708018599, - "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", "type": "github" }, "original": { @@ -406,20 +1695,19 @@ }, "pre-commit-hooks_2": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", - "gitignore": "gitignore_2", + "flake-compat": "flake-compat_10", + "gitignore": "gitignore_6", "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_2" + "nixpkgs-stable": "nixpkgs-stable_4" }, "locked": { - "lastModified": 1708018599, - "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { @@ -428,73 +1716,63 @@ "type": "github" } }, - "root": { + "pre-commit-hooks_3": { "inputs": { - "flake-parts": "flake-parts", - "gen-luarc": "gen-luarc", - "neorocks": "neorocks", - "nixpkgs": "nixpkgs_3", - "pre-commit-hooks": "pre-commit-hooks_2" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" + "flake-compat": "flake-compat_15", + "gitignore": "gitignore_9", + "nixpkgs": [ + "rocks-nvim-flake", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_6" }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", "type": "github" } }, - "systems_3": { + "rocks-nvim-flake": { + "inputs": { + "flake-parts": "flake-parts_11", + "gen-luarc": "gen-luarc_3", + "neorocks": "neorocks_3", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks_3" + }, "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1718500913, + "narHash": "sha256-2Lxhn9MRcyao82X2lDpONJJnGPy/QT6Ml68H9bA3GsE=", + "owner": "nvim-neorocks", + "repo": "rocks.nvim", + "rev": "40c9757cd4ec5680740c901bb3c8ffcb7495c05e", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "nvim-neorocks", + "repo": "rocks.nvim", "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" + "root": { + "inputs": { + "flake-parts": "flake-parts", + "gen-luarc": "gen-luarc", + "lz-n-flake": "lz-n-flake", + "neorocks": "neorocks_2", + "nixpkgs": "nixpkgs_11", + "pre-commit-hooks": "pre-commit-hooks_2", + "rocks-nvim-flake": "rocks-nvim-flake" } } }, diff --git a/flake.nix b/flake.nix index d02d310..71094c4 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,13 @@ gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json"; + rocks-nvim-flake = { + url = "github:nvim-neorocks/rocks.nvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + lz-n-flake.url = "github:nvim-neorocks/lz.n"; + flake-parts.url = "github:hercules-ci/flake-parts"; pre-commit-hooks = { @@ -26,6 +33,8 @@ nixpkgs, neorocks, gen-luarc, + rocks-nvim-flake, + lz-n-flake, flake-parts, pre-commit-hooks, ... @@ -46,9 +55,11 @@ pkgs = import nixpkgs { inherit system; overlays = [ + rocks-nvim-flake.overlays.default self.overlays.default neorocks.overlays.default gen-luarc.overlays.default + lz-n-flake.overlays.default ]; }; @@ -57,6 +68,7 @@ neodev-types = "nightly"; plugins = with pkgs.lua51Packages; [ rocks-nvim + lz-n ]; }; @@ -86,20 +98,19 @@ ${pre-commit-check.shellHook} ln -fs ${pkgs.luarc-to-json luarc} .luarc.json ''; - buildInputs = with pre-commit-hooks.packages.${system}; - [ - alejandra - lua-language-server - stylua - luacheck - editorconfig-checker - ] + buildInputs = + self.checks.${system}.pre-commit-check.enabledPackages ++ (with pkgs; [ - (lua5_1.withPackages (ps: with ps; [luarocks dkjson])) + busted-nightly + lua-language-server ]); }; in { - packages.default = pkgs.lua51Packages.rocks-lazy-nvim; + packages = rec { + default = neovim-with-rocks; + neovim-with-rocks = pkgs.neovim-with-rocks; + # rocks-lazy-nvim = pkgs.lua51Packages.rocks-lazy-nvim; + }; devShells = { default = devShell; @@ -114,7 +125,7 @@ }; }; flake = { - overlays.default = import ./nix/overlay.nix {inherit self;}; + overlays.default = import ./nix/overlay.nix {inherit self rocks-nvim-flake;}; }; }; } diff --git a/lua/rocks-lazy/meta.lua b/lua/rocks-lazy/meta.lua new file mode 100644 index 0000000..023a177 --- /dev/null +++ b/lua/rocks-lazy/meta.lua @@ -0,0 +1,32 @@ +---@meta +error("Cannot require a meta module") + +---@class rocks.lazy.RockSpec: RockSpec lz.n.PluginSpecHandlers +---@field name string Name of the plugin +---@field opt? boolean If 'true', will not be loaded on startup. +--- +---Load a plugin on one or more |autocmd-events|. +---@field event? string | lz.n.EventSpec[] +--- +--- Load a plugin on one or more |user-commands|. +--- @field cmd? string[]|string +--- +--- Load a plugin on one or more |FileType| events. +--- @field ft? string[]|string +--- +--- Load a plugin on one or more |key-mapping|s. +--- @field keys? string|string[]|lz.n.KeysSpec[] +--- +--- Load a plugin on one or more |colorscheme| events. +--- @field colorscheme? string[]|string + +---@class rocks.lazy.KeysSpec: vim.keymap.set.Opts +---@field lhs string +---@field rhs? string +---@field desc? string +---@field noremap? boolean +---@field remap? boolean +---@field expr? boolean +---@field nowait? boolean +---@field ft? string|string[] +---@field mode? string|string[] diff --git a/nix/overlay.nix b/nix/overlay.nix index e90063b..29e3cf5 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,7 +1,32 @@ -{self}: final: prev: let +{ + self, + rocks-nvim-flake, +}: final: prev: let name = "rocks-lazy.nvim"; luaPackage-override = luaself: luaprev: { + lz-n = luaself.callPackage ({ + buildLuarocksPackage, + fetchurl, + fetchzip, + luaOlder, + }: + buildLuarocksPackage { + pname = "lz.n"; + version = "1.2.3-1"; + knownRockspec = + (fetchurl { + url = "mirror://luarocks/lz.n-1.2.3-1.rockspec"; + sha256 = "1h89pkj8j82wfzqvia54q70y1zpdwkc4j8kifl3xpmyyp4kgibkw"; + }) + .outPath; + src = fetchzip { + url = "https://github.com/nvim-neorocks/lz.n/archive/v1.2.3.zip"; + sha256 = "1bms3ynha48mar2zfmyd3vlvxz7v3q1v5jxp1dhxwmyxa1dp2vhc"; + }; + disabled = luaOlder "5.1"; + }) {}; + rocks-lazy-nvim = luaself.callPackage ({ luaOlder, buildLuarocksPackage, @@ -25,10 +50,72 @@ packageOverrides = luaPackage-override; }; lua51Packages = final.lua5_1.pkgs; + luajit = prev.luajit.override { + packageOverrides = luaPackage-override; + }; + luajitPackages = final.luajit.pkgs; + + neovim-with-rocks = let + rocks = rocks-nvim-flake.packages.${final.system}.rocks-nvim; + rocks-lazy = final.luajitPackages.rocks-lazy-nvim; + lz-n = final.luajitPackages.lz-n; + neovimConfig = final.neovimUtils.makeNeovimConfig { + withPython3 = true; + viAlias = false; + vimAlias = false; + # plugins = [ final.vimPlugins.rocks-nvim ]; + extraLuaPackages = ps: [ps.rocks-nvim]; + }; + in + final.wrapNeovimUnstable final.neovim-nightly (neovimConfig + // { + luaRcContent = + /* + lua + */ + '' + -- Copied from installer.lua + local rocks_config = { + rocks_path = vim.fn.stdpath("data") .. "/rocks", + luarocks_binary = "${final.luajitPackages.luarocks}/bin/luarocks", + } + + vim.g.rocks_nvim = rocks_config + + local luarocks_path = { + vim.fs.joinpath("${rocks}", "share", "lua", "5.1", "?.lua"), + vim.fs.joinpath("${rocks}", "share", "lua", "5.1", "?", "init.lua"), + vim.fs.joinpath("${rocks-lazy}", "share", "lua", "5.1", "?.lua"), + vim.fs.joinpath("${rocks-lazy}", "share", "lua", "5.1", "?", "init.lua"), + vim.fs.joinpath("${lz-n}", "share", "lua", "5.1", "?.lua"), + vim.fs.joinpath("${lz-n}", "share", "lua", "5.1", "?", "init.lua"), + vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"), + vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?", "init.lua"), + } + package.path = package.path .. ";" .. table.concat(luarocks_path, ";") + + local luarocks_cpath = { + vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"), + vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"), + } + package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";") + + vim.opt.runtimepath:append(vim.fs.joinpath("${rocks}", "rocks.nvim-scm-1-rocks", "rocks.nvim", "*")) + vim.opt.runtimepath:append(vim.fs.joinpath("${rocks-lazy}", "rocks-lazy.nvim-scm-1-rocks", "rocks-lazy.nvim", "*")) + ''; + wrapRc = true; + wrapperArgs = + final.lib.escapeShellArgs neovimConfig.wrapperArgs + + " " + + ''--set NVIM_APPNAME "nvimrocks"''; + }); in { inherit lua5_1 lua51Packages + luajit + luajitPackages + neovim-with-rocks ; vimPlugins = diff --git a/plugin/rocks-lazy.lua b/plugin/rocks-lazy.lua index 7b10ec4..18f0535 100644 --- a/plugin/rocks-lazy.lua +++ b/plugin/rocks-lazy.lua @@ -3,3 +3,77 @@ if vim.g.did_load_rocks_lazy then end vim.g.did_load_rocks_lazy = true + +local api = require("rocks.api") +local lz_n = require("lz.n") + +local user_rocks = api.get_user_rocks() + +local has_rocks_config, rocks_config = pcall(require, "rocks-config") +---@type fun(name: string) | nil +local config_hook = has_rocks_config and type(rocks_config.configure) == "function" and rocks_config.configure or nil + +--- HACK: For some reason, if a RockSpec contains a list +--- (e.g. colorscheme = [ .. ]) then vim.deepcopy errors +--- if we don't fix it. This is possibly a toml_edit.lua bug! +--- +---@generic T +---@param value T | T[] +---@return T | T[] +local function clone_toml_list(value) + if vim.islist(value) then + ---@cast value string[] + return vim.list_extend({}, value) + end + return value +end + +---@param keys string | string[] | rocks.lazy.KeysSpec[] | nil +---@return string | string[] | lz.n.KeysSpec[] | nil +local function to_lz_n_keys_spec(keys) + if not keys or type(keys) == "string" then + return keys + end + return vim.iter(keys) + :map(function(value) + if type(value) ~= "table" then + return value + end + local result = vim.deepcopy(value) + result[1] = value.lhs + result.lhs = nil + result[2] = value.rhs + result.rhs = nil + return result + end) + :totable() +end + +---@type lz.n.PluginSpec[] +local specs = vim.iter(user_rocks) + :filter(function(_, rock) + ---@cast rock rocks.lazy.RockSpec + return rock.opt == true + or rock.event ~= nil + or rock.cmd ~= nil + or rock.keys ~= nil + or rock.ft ~= nil + or rock.colorscheme ~= nil + end) + :map(function(_, rock) + ---@cast rock rocks.lazy.RockSpec + ---@type lz.n.PluginSpec + return { + rock.name, + before = config_hook, + lazy = rock.opt, + event = clone_toml_list(rock.event), + cmd = clone_toml_list(rock.cmd), + keys = to_lz_n_keys_spec(clone_toml_list(rock.keys)), + ft = clone_toml_list(rock.ft), + colorscheme = clone_toml_list(rock.colorscheme), + } + end) + :totable() + +lz_n.load(specs) diff --git a/rocks-lazy.nvim-scm-1.rockspec b/rocks-lazy.nvim-scm-1.rockspec index fdcb23c..7de2291 100644 --- a/rocks-lazy.nvim-scm-1.rockspec +++ b/rocks-lazy.nvim-scm-1.rockspec @@ -6,7 +6,7 @@ version = _MODREV .. _SPECREV dependencies = { "lua >= 5.1", "rocks.nvim >= 1.19.0", - "lz.n >= 1.0.0", + "lz.n >= 1.2.3", } source = {