From f07dd1dde090c231aa3cb4539d0c8695b93ee653 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 24 May 2024 14:06:50 +0200 Subject: refactor(pkgs/by-name/vi/vim-plugins): Give nixpkgs compatible name Nixpkgs already provides `vimPlugins` so having a `vim-plugins` set is rather confusing. Calling it `vimExtraPlugins` resolves this confusion. --- pkgs/by-name/vi/vim-plugins/README.md | 92 ---------------------- pkgs/by-name/vi/vim-plugins/check.nix | 37 --------- pkgs/by-name/vi/vim-plugins/overrides.nix | 34 -------- pkgs/by-name/vi/vim-plugins/package.nix | 19 ----- pkgs/by-name/vi/vim-plugins/plugins/.plugins.json | 7 -- pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt | 1 - pkgs/by-name/vi/vim-plugins/plugins/default.nix | 55 ------------- pkgs/by-name/vi/vim-plugins/plugins/manifest.txt | 3 - pkgs/by-name/vi/vim-plugins/plugins/plugins.md | 7 -- pkgs/by-name/vi/vim-plugins/plugins/whitelist.txt | 0 pkgs/by-name/vi/vim-plugins/update.sh | 27 ------- pkgs/by-name/vi/vimExtraPlugins/README.md | 92 ++++++++++++++++++++++ pkgs/by-name/vi/vimExtraPlugins/check.nix | 37 +++++++++ pkgs/by-name/vi/vimExtraPlugins/overrides.nix | 34 ++++++++ pkgs/by-name/vi/vimExtraPlugins/package.nix | 19 +++++ .../vi/vimExtraPlugins/plugins/.plugins.json | 7 ++ .../vi/vimExtraPlugins/plugins/blacklist.txt | 1 + .../by-name/vi/vimExtraPlugins/plugins/default.nix | 55 +++++++++++++ .../vi/vimExtraPlugins/plugins/manifest.txt | 3 + pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md | 7 ++ .../vi/vimExtraPlugins/plugins/whitelist.txt | 0 pkgs/by-name/vi/vimExtraPlugins/update.sh | 27 +++++++ 22 files changed, 282 insertions(+), 282 deletions(-) delete mode 100644 pkgs/by-name/vi/vim-plugins/README.md delete mode 100644 pkgs/by-name/vi/vim-plugins/check.nix delete mode 100644 pkgs/by-name/vi/vim-plugins/overrides.nix delete mode 100644 pkgs/by-name/vi/vim-plugins/package.nix delete mode 100644 pkgs/by-name/vi/vim-plugins/plugins/.plugins.json delete mode 100644 pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt delete mode 100644 pkgs/by-name/vi/vim-plugins/plugins/default.nix delete mode 100644 pkgs/by-name/vi/vim-plugins/plugins/manifest.txt delete mode 100644 pkgs/by-name/vi/vim-plugins/plugins/plugins.md delete mode 100644 pkgs/by-name/vi/vim-plugins/plugins/whitelist.txt delete mode 100755 pkgs/by-name/vi/vim-plugins/update.sh create mode 100644 pkgs/by-name/vi/vimExtraPlugins/README.md create mode 100644 pkgs/by-name/vi/vimExtraPlugins/check.nix create mode 100644 pkgs/by-name/vi/vimExtraPlugins/overrides.nix create mode 100644 pkgs/by-name/vi/vimExtraPlugins/package.nix create mode 100644 pkgs/by-name/vi/vimExtraPlugins/plugins/.plugins.json create mode 100644 pkgs/by-name/vi/vimExtraPlugins/plugins/blacklist.txt create mode 100644 pkgs/by-name/vi/vimExtraPlugins/plugins/default.nix create mode 100644 pkgs/by-name/vi/vimExtraPlugins/plugins/manifest.txt create mode 100644 pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md create mode 100644 pkgs/by-name/vi/vimExtraPlugins/plugins/whitelist.txt create mode 100755 pkgs/by-name/vi/vimExtraPlugins/update.sh (limited to 'pkgs/by-name/vi') diff --git a/pkgs/by-name/vi/vim-plugins/README.md b/pkgs/by-name/vi/vim-plugins/README.md deleted file mode 100644 index e8169951..00000000 --- a/pkgs/by-name/vi/vim-plugins/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Fork - -All files in this repository where forked form [here](https://github.com/NixNeovim/NixNeovimPlugins) on commit `5010b91eb03696574c3c293f072a090618227e87`. -Below the original README. They were licensed under the MIT license. - -# All vim plugins, ready to go - -This repo auto generates nix packages for vim/neovim plugins. -Packages are automatically updated twice per week using a GitHub Actions. -Plugins are fetched from the `manifest.txt` and [awesome-neovim][0] repo. - -This is a fork of [this repo](https://github.com/m15a/nixpkgs-vim-extra-plugins); however, we fetch all additions from the original repo, so we will never have less plugins. -Further, the original deletes plugins that are available in the nixpkgs. We, instead, try to assemble a list of all available plugins. -Therefore, to access plugins you will never have to search in two places. - -This repo can be used as a stand-alone, by adding it to your inputs. -However, we recommend to use [NixNeovim](https://github.com/NixNeovim/NixNeovim) modules instead, and use this only when you need a plugins, which does not have a module, yet. - -## Available plugins - -The [plugins.md](plugins.md) contains an auto-generated list of all available plugins. - -## Usage - -- We recommend using [NixNeovim](https://github.com/NixNeovim/NixNeovim), and only access the plugins directly when they do not have a module in NixNeovim. - -However, you can also use this repo without NixNeovim: -To access the plugins, you need to add the overlay. -The overlay adds extra Vim plugins to `pkgs.vimExtraPlugins`. -First, add this repo to your inputs: - -``` -inputs.nixneovimplugins.url = github:jooooscha/nixpkgs-vim-extra-plugins -``` - -Next, apply the provided overlay: - -``` -nixpkgs.overlays = [ - inputs.nixneovimplugins.overlays.default -]; -``` - -Finally, you can add the packages to your vim/neovim config. For example you can use [NixNeovim](https://github.com/NixNeovim/Nixneovim) or you can add the plugins directly: - -``` - programs.neovim = { - plugins = [ - pkgs.vimExtraPlugins.nvim-colorizer-lua - ]; - } -``` - -More info on using neovim with nix can be found here: [NixOS Neovim](https://nixos.wiki/wiki/Neovim) - -## Contribution - -### How to add a new plugin - -#### 1. Add the plugin to manifest.txt: - -``` -# Examples - -haringsrob/nvim_context_vt -sourcehut:henriquehbr/ataraxis.lua -gitlab:yorickpeterse/nvim-pqf -williamboman/mason.nvim:45b9a4da776d9fb017960b3ac7241161fb7bc578 -foo/bar::baz --> renamed to baz -foo/bar:dev --> using dev branch -``` - -Supported are Github (default), SourceHut, and GitLab. - -#### 2. Create a Pull Request - -- Create a pull request with the changed manifest.txt (and blacklist.txt if neccessary). -- A GitHub action will check your contribution and generate all neccessary nix code for your new plugin. It will also take care of sorting and cleaning the manifest.txt -- After all checks have passed, I will merge your change. - -I am happy for any contribution. :) - -### How to remove a new plugin - -Copy the entry from manifest.txt to blacklist.txt and create a PR. -The GitHub Actions will do the rest, including removing the entry from manifest.txt - -## Credits - -This is originally based on work by [m15a](https://github.com/m15a/nixpkgs-vim-extra-plugins) - -[0]: https://github.com/rockerBOO/awesome-neovim diff --git a/pkgs/by-name/vi/vim-plugins/check.nix b/pkgs/by-name/vi/vim-plugins/check.nix deleted file mode 100644 index ad23e2c7..00000000 --- a/pkgs/by-name/vi/vim-plugins/check.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - # checks if a plugin has a license - hasLicense = _: pkg: let - warn = x: lib.warn x x; - - msg = - if builtins.hasAttr "license" pkg.meta - then "${pkg.name} has license" - else warn "${pkg.name} has no license"; - - msg' = lib.replaceStrings [" "] ["-"] msg; - in - pkgs.runCommandNoCC msg' {} "echo : > $out "; - - # function to check License for all packages - check-missing-licenses = let - buildInputs = - lib.mapAttrsToList - hasLicense - pkgs.vimExtraPlugins; - in - pkgs.runCommandNoCC - "check-missing-licenses" - {inherit buildInputs;} - "echo : > $out"; -in { - checks = - pkgs.vimExtraPlugins - // { - inherit check-missing-licenses; - inherit (pkgs) update-vim-plugins; - }; -} diff --git a/pkgs/by-name/vi/vim-plugins/overrides.nix b/pkgs/by-name/vi/vim-plugins/overrides.nix deleted file mode 100644 index e03a78b1..00000000 --- a/pkgs/by-name/vi/vim-plugins/overrides.nix +++ /dev/null @@ -1,34 +0,0 @@ -final: prev: let - inherit (final) lib; - - /* - * Mark broken packages here. - */ - markBrokenPackages = self: super: - lib.mapAttrs (attrName: broken: - super.${attrName}.overrideAttrs (old: { - meta = old.meta // {inherit broken;}; - })) - { - # = true; - }; - - /* - * Add licenses if missing or incorrect in generated ./pkgs/vim-plugins.nix. - */ - fixLicenses = self: super: - lib.mapAttrs (attrName: license: - super.${attrName}.overrideAttrs (old: { - meta = old.meta // {inherit license;}; - })) (with lib.licenses; { - /* - * Example: - * plugin-name = [] - */ - }); -in { - vimExtraPlugins = prev.vimExtraPlugins.extend (lib.composeManyExtensions [ - markBrokenPackages - fixLicenses - ]); -} diff --git a/pkgs/by-name/vi/vim-plugins/package.nix b/pkgs/by-name/vi/vim-plugins/package.nix deleted file mode 100644 index e2e4a117..00000000 --- a/pkgs/by-name/vi/vim-plugins/package.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - lib, - fetchurl, - fetchgit, - vimUtils, -}: let - origin = import ./plugins { - inherit - (vimUtils) - buildVimPlugin - ; - inherit - lib - fetchurl - fetchgit - ; - }; -in - origin diff --git a/pkgs/by-name/vi/vim-plugins/plugins/.plugins.json b/pkgs/by-name/vi/vim-plugins/plugins/.plugins.json deleted file mode 100644 index 9331bc8f..00000000 --- a/pkgs/by-name/vi/vim-plugins/plugins/.plugins.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ThePrimeagen/harpoon:master": "{\"description\": \"\", \"homepage\": \"https://github.com/ThePrimeagen/harpoon\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"harpoon\", \"owner\": \"ThePrimeagen\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1w4hi9hbdjwdhb4vwa0x08a25vbcxqg1d5cskm2qvjy5fdlqils0\", \"url\": \"https://github.com/ThePrimeagen/harpoon/archive/ccae1b9bec717ae284906b0bf83d720e59d12b91.tar.gz\"}, \"source_line\": \"ThePrimeagen/harpoon:master\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cMGg==\"]], \"py/object\": \"datetime.date\"}}", - "akinsho/toggleterm.nvim": "{\"description\": \"A neovim lua plugin to help easily manage multiple terminal windows\", \"homepage\": \"https://github.com/akinsho/toggleterm.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"gpl3Only\"]}]}, \"name\": \"toggleterm-nvim\", \"owner\": \"akinsho\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"0nx69q9597vy7lzvvh58fnjyin23ns6apmyp532sgf547bw7mld6\", \"url\": \"https://github.com/akinsho/toggleterm.nvim/archive/cbd041d91b90cd3c02df03fe6133208888f8e008.tar.gz\"}, \"source_line\": \"akinsho/toggleterm.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cMBg==\"]], \"py/object\": \"datetime.date\"}}", - "andrewferrier/debugprint.nvim": "{\"description\": \"Debugging in NeoVim the print() way!\", \"homepage\": \"https://github.com/andrewferrier/debugprint.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"debugprint-nvim\", \"owner\": \"andrewferrier\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"06r1jhx7jd15q8wvnw0xqwk3bkx39pm4pbv70hf9ggd6zsnmsrmn\", \"url\": \"https://github.com/andrewferrier/debugprint.nvim/archive/54297dd0a4f318b279a1cb954e7714f3942df123.tar.gz\"}, \"source_line\": \"andrewferrier/debugprint.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+gDHQ==\"]], \"py/object\": \"datetime.date\"}}", - "lmburns/lf.nvim": "{\"description\": \"Lf file manager for Neovim (in Lua)\", \"homepage\": \"https://github.com/lmburns/lf.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"lf-nvim\", \"owner\": \"lmburns\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1nwf90bnzqhlgs007gg6xpx0vf4r1d19586nld78ipi1ch7nz4px\", \"url\": \"https://github.com/lmburns/lf.nvim/archive/69ab1efcffee6928bf68ac9bd0c016464d9b2c8b.tar.gz\"}, \"source_line\": \"lmburns/lf.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cKAw==\"]], \"py/object\": \"datetime.date\"}}", - "nvim-telescope/telescope-bibtex.nvim": "{\"description\": \"A telescope.nvim extension to search and paste bibtex entries into your TeX files.\", \"homepage\": \"https://github.com/nvim-telescope/telescope-bibtex.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"telescope-bibtex-nvim\", \"owner\": \"nvim-telescope\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1sd6p8cvv3dckgrhc7grlyfcibjxhxbfyh0w7p5m4mdcazhy1kqs\", \"url\": \"https://github.com/nvim-telescope/telescope-bibtex.nvim/archive/289a6f86ebec06e8ae1590533b732b9981d84900.tar.gz\"}, \"source_line\": \"nvim-telescope/telescope-bibtex.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+gDHA==\"]], \"py/object\": \"datetime.date\"}}" -} \ No newline at end of file diff --git a/pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt b/pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt deleted file mode 100644 index 8b137891..00000000 --- a/pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/pkgs/by-name/vi/vim-plugins/plugins/default.nix b/pkgs/by-name/vi/vim-plugins/plugins/default.nix deleted file mode 100644 index df09e446..00000000 --- a/pkgs/by-name/vi/vim-plugins/plugins/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - lib, - buildVimPlugin, - fetchurl, - fetchgit, -}: { - /* - Generated from: ThePrimeagen/harpoon:master - */ - harpoon = buildVimPlugin { - pname = "harpoon"; - version = "2023-12-26"; - src = fetchurl { - url = "https://github.com/ThePrimeagen/harpoon/archive/ccae1b9bec717ae284906b0bf83d720e59d12b91.tar.gz"; - sha256 = "1w4hi9hbdjwdhb4vwa0x08a25vbcxqg1d5cskm2qvjy5fdlqils0"; - }; - meta = with lib; { - description = ""; - homepage = "https://github.com/ThePrimeagen/harpoon"; - license = with licenses; [mit]; - }; - }; - /* - Generated from: lmburns/lf.nvim - */ - lf-nvim = buildVimPlugin { - pname = "lf-nvim"; - version = "2023-10-03"; - src = fetchurl { - url = "https://github.com/lmburns/lf.nvim/archive/69ab1efcffee6928bf68ac9bd0c016464d9b2c8b.tar.gz"; - sha256 = "1nwf90bnzqhlgs007gg6xpx0vf4r1d19586nld78ipi1ch7nz4px"; - }; - meta = with lib; { - description = "Lf file manager for Neovim (in Lua)"; - homepage = "https://github.com/lmburns/lf.nvim"; - license = with licenses; [mit]; - }; - }; - /* - Generated from: nvim-telescope/telescope-bibtex.nvim - */ - telescope-bibtex-nvim = buildVimPlugin { - pname = "telescope-bibtex-nvim"; - version = "2024-03-28"; - src = fetchurl { - url = "https://github.com/nvim-telescope/telescope-bibtex.nvim/archive/289a6f86ebec06e8ae1590533b732b9981d84900.tar.gz"; - sha256 = "1sd6p8cvv3dckgrhc7grlyfcibjxhxbfyh0w7p5m4mdcazhy1kqs"; - }; - meta = with lib; { - description = "A telescope.nvim extension to search and paste bibtex entries into your TeX files."; - homepage = "https://github.com/nvim-telescope/telescope-bibtex.nvim"; - license = with licenses; [mit]; - }; - }; -} diff --git a/pkgs/by-name/vi/vim-plugins/plugins/manifest.txt b/pkgs/by-name/vi/vim-plugins/plugins/manifest.txt deleted file mode 100644 index 615083c8..00000000 --- a/pkgs/by-name/vi/vim-plugins/plugins/manifest.txt +++ /dev/null @@ -1,3 +0,0 @@ -lmburns/lf.nvim -nvim-telescope/telescope-bibtex.nvim -ThePrimeagen/harpoon:master diff --git a/pkgs/by-name/vi/vim-plugins/plugins/plugins.md b/pkgs/by-name/vi/vim-plugins/plugins/plugins.md deleted file mode 100644 index 4f73f811..00000000 --- a/pkgs/by-name/vi/vim-plugins/plugins/plugins.md +++ /dev/null @@ -1,7 +0,0 @@ -- Plugin count: 3 - -| Repo | Last Update | Nix package name | Last checked | -|:---|:---|:---|:---| -| [ThePrimeagen/harpoon:master](https://github.com/ThePrimeagen/harpoon) | 2023-12-26 | `harpoon` | 2024-05-09 | -| [lmburns/lf.nvim](https://github.com/lmburns/lf.nvim) | 2023-10-03 | `lf-nvim` | 2024-05-09 | -| [nvim-telescope/telescope-bibtex.nvim](https://github.com/nvim-telescope/telescope-bibtex.nvim) | 2024-03-28 | `telescope-bibtex-nvim` | 2024-05-09 | diff --git a/pkgs/by-name/vi/vim-plugins/plugins/whitelist.txt b/pkgs/by-name/vi/vim-plugins/plugins/whitelist.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/pkgs/by-name/vi/vim-plugins/update.sh b/pkgs/by-name/vi/vim-plugins/update.sh deleted file mode 100755 index 6a0d3452..00000000 --- a/pkgs/by-name/vi/vim-plugins/update.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env sh - -BASE_DIR="$(readlink -f "$(dirname "$0")/plugins")" - -# Fetch plugins -cd "$BASE_DIR" || (echo "BUG: No '$BASE_DIR'" && exit 1) - -# Cleanup manifest -sort -o "$BASE_DIR/manifest.txt" "$BASE_DIR/manifest.txt" -sort -o "$BASE_DIR/blacklist.txt" "$BASE_DIR/blacklist.txt" -## Remove all plugins, which are on the blacklist -# The same file is read and written to -# shellcheck disable=SC2005 -echo "$(comm -23 "$BASE_DIR/manifest.txt" "$BASE_DIR/blacklist.txt")" >"$BASE_DIR/manifest.txt" - -# Backup vim-plugins.nix -mv "$BASE_DIR/default.nix" "$BASE_DIR/default.nix.bak" -echo "{...} : {}" >"$BASE_DIR/default.nix" - -# Generate derivations for new plugins (this binary is provided by the dev-environment) -update-vim-plugins cleanup "$BASE_DIR" - -# Restore vim-plugins.nix -mv "$BASE_DIR/default.nix.bak" "$BASE_DIR/default.nix" - -# Update new plugins -update-vim-plugins update "$BASE_DIR" --all diff --git a/pkgs/by-name/vi/vimExtraPlugins/README.md b/pkgs/by-name/vi/vimExtraPlugins/README.md new file mode 100644 index 00000000..e8169951 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/README.md @@ -0,0 +1,92 @@ +# Fork + +All files in this repository where forked form [here](https://github.com/NixNeovim/NixNeovimPlugins) on commit `5010b91eb03696574c3c293f072a090618227e87`. +Below the original README. They were licensed under the MIT license. + +# All vim plugins, ready to go + +This repo auto generates nix packages for vim/neovim plugins. +Packages are automatically updated twice per week using a GitHub Actions. +Plugins are fetched from the `manifest.txt` and [awesome-neovim][0] repo. + +This is a fork of [this repo](https://github.com/m15a/nixpkgs-vim-extra-plugins); however, we fetch all additions from the original repo, so we will never have less plugins. +Further, the original deletes plugins that are available in the nixpkgs. We, instead, try to assemble a list of all available plugins. +Therefore, to access plugins you will never have to search in two places. + +This repo can be used as a stand-alone, by adding it to your inputs. +However, we recommend to use [NixNeovim](https://github.com/NixNeovim/NixNeovim) modules instead, and use this only when you need a plugins, which does not have a module, yet. + +## Available plugins + +The [plugins.md](plugins.md) contains an auto-generated list of all available plugins. + +## Usage + +- We recommend using [NixNeovim](https://github.com/NixNeovim/NixNeovim), and only access the plugins directly when they do not have a module in NixNeovim. + +However, you can also use this repo without NixNeovim: +To access the plugins, you need to add the overlay. +The overlay adds extra Vim plugins to `pkgs.vimExtraPlugins`. +First, add this repo to your inputs: + +``` +inputs.nixneovimplugins.url = github:jooooscha/nixpkgs-vim-extra-plugins +``` + +Next, apply the provided overlay: + +``` +nixpkgs.overlays = [ + inputs.nixneovimplugins.overlays.default +]; +``` + +Finally, you can add the packages to your vim/neovim config. For example you can use [NixNeovim](https://github.com/NixNeovim/Nixneovim) or you can add the plugins directly: + +``` + programs.neovim = { + plugins = [ + pkgs.vimExtraPlugins.nvim-colorizer-lua + ]; + } +``` + +More info on using neovim with nix can be found here: [NixOS Neovim](https://nixos.wiki/wiki/Neovim) + +## Contribution + +### How to add a new plugin + +#### 1. Add the plugin to manifest.txt: + +``` +# Examples + +haringsrob/nvim_context_vt +sourcehut:henriquehbr/ataraxis.lua +gitlab:yorickpeterse/nvim-pqf +williamboman/mason.nvim:45b9a4da776d9fb017960b3ac7241161fb7bc578 +foo/bar::baz --> renamed to baz +foo/bar:dev --> using dev branch +``` + +Supported are Github (default), SourceHut, and GitLab. + +#### 2. Create a Pull Request + +- Create a pull request with the changed manifest.txt (and blacklist.txt if neccessary). +- A GitHub action will check your contribution and generate all neccessary nix code for your new plugin. It will also take care of sorting and cleaning the manifest.txt +- After all checks have passed, I will merge your change. + +I am happy for any contribution. :) + +### How to remove a new plugin + +Copy the entry from manifest.txt to blacklist.txt and create a PR. +The GitHub Actions will do the rest, including removing the entry from manifest.txt + +## Credits + +This is originally based on work by [m15a](https://github.com/m15a/nixpkgs-vim-extra-plugins) + +[0]: https://github.com/rockerBOO/awesome-neovim diff --git a/pkgs/by-name/vi/vimExtraPlugins/check.nix b/pkgs/by-name/vi/vimExtraPlugins/check.nix new file mode 100644 index 00000000..ad23e2c7 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/check.nix @@ -0,0 +1,37 @@ +{ + pkgs, + lib, + ... +}: let + # checks if a plugin has a license + hasLicense = _: pkg: let + warn = x: lib.warn x x; + + msg = + if builtins.hasAttr "license" pkg.meta + then "${pkg.name} has license" + else warn "${pkg.name} has no license"; + + msg' = lib.replaceStrings [" "] ["-"] msg; + in + pkgs.runCommandNoCC msg' {} "echo : > $out "; + + # function to check License for all packages + check-missing-licenses = let + buildInputs = + lib.mapAttrsToList + hasLicense + pkgs.vimExtraPlugins; + in + pkgs.runCommandNoCC + "check-missing-licenses" + {inherit buildInputs;} + "echo : > $out"; +in { + checks = + pkgs.vimExtraPlugins + // { + inherit check-missing-licenses; + inherit (pkgs) update-vim-plugins; + }; +} diff --git a/pkgs/by-name/vi/vimExtraPlugins/overrides.nix b/pkgs/by-name/vi/vimExtraPlugins/overrides.nix new file mode 100644 index 00000000..e03a78b1 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/overrides.nix @@ -0,0 +1,34 @@ +final: prev: let + inherit (final) lib; + + /* + * Mark broken packages here. + */ + markBrokenPackages = self: super: + lib.mapAttrs (attrName: broken: + super.${attrName}.overrideAttrs (old: { + meta = old.meta // {inherit broken;}; + })) + { + # = true; + }; + + /* + * Add licenses if missing or incorrect in generated ./pkgs/vim-plugins.nix. + */ + fixLicenses = self: super: + lib.mapAttrs (attrName: license: + super.${attrName}.overrideAttrs (old: { + meta = old.meta // {inherit license;}; + })) (with lib.licenses; { + /* + * Example: + * plugin-name = [] + */ + }); +in { + vimExtraPlugins = prev.vimExtraPlugins.extend (lib.composeManyExtensions [ + markBrokenPackages + fixLicenses + ]); +} diff --git a/pkgs/by-name/vi/vimExtraPlugins/package.nix b/pkgs/by-name/vi/vimExtraPlugins/package.nix new file mode 100644 index 00000000..e2e4a117 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/package.nix @@ -0,0 +1,19 @@ +{ + lib, + fetchurl, + fetchgit, + vimUtils, +}: let + origin = import ./plugins { + inherit + (vimUtils) + buildVimPlugin + ; + inherit + lib + fetchurl + fetchgit + ; + }; +in + origin diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/.plugins.json b/pkgs/by-name/vi/vimExtraPlugins/plugins/.plugins.json new file mode 100644 index 00000000..9331bc8f --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/plugins/.plugins.json @@ -0,0 +1,7 @@ +{ + "ThePrimeagen/harpoon:master": "{\"description\": \"\", \"homepage\": \"https://github.com/ThePrimeagen/harpoon\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"harpoon\", \"owner\": \"ThePrimeagen\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1w4hi9hbdjwdhb4vwa0x08a25vbcxqg1d5cskm2qvjy5fdlqils0\", \"url\": \"https://github.com/ThePrimeagen/harpoon/archive/ccae1b9bec717ae284906b0bf83d720e59d12b91.tar.gz\"}, \"source_line\": \"ThePrimeagen/harpoon:master\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cMGg==\"]], \"py/object\": \"datetime.date\"}}", + "akinsho/toggleterm.nvim": "{\"description\": \"A neovim lua plugin to help easily manage multiple terminal windows\", \"homepage\": \"https://github.com/akinsho/toggleterm.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"gpl3Only\"]}]}, \"name\": \"toggleterm-nvim\", \"owner\": \"akinsho\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"0nx69q9597vy7lzvvh58fnjyin23ns6apmyp532sgf547bw7mld6\", \"url\": \"https://github.com/akinsho/toggleterm.nvim/archive/cbd041d91b90cd3c02df03fe6133208888f8e008.tar.gz\"}, \"source_line\": \"akinsho/toggleterm.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cMBg==\"]], \"py/object\": \"datetime.date\"}}", + "andrewferrier/debugprint.nvim": "{\"description\": \"Debugging in NeoVim the print() way!\", \"homepage\": \"https://github.com/andrewferrier/debugprint.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"debugprint-nvim\", \"owner\": \"andrewferrier\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"06r1jhx7jd15q8wvnw0xqwk3bkx39pm4pbv70hf9ggd6zsnmsrmn\", \"url\": \"https://github.com/andrewferrier/debugprint.nvim/archive/54297dd0a4f318b279a1cb954e7714f3942df123.tar.gz\"}, \"source_line\": \"andrewferrier/debugprint.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+gDHQ==\"]], \"py/object\": \"datetime.date\"}}", + "lmburns/lf.nvim": "{\"description\": \"Lf file manager for Neovim (in Lua)\", \"homepage\": \"https://github.com/lmburns/lf.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"lf-nvim\", \"owner\": \"lmburns\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1nwf90bnzqhlgs007gg6xpx0vf4r1d19586nld78ipi1ch7nz4px\", \"url\": \"https://github.com/lmburns/lf.nvim/archive/69ab1efcffee6928bf68ac9bd0c016464d9b2c8b.tar.gz\"}, \"source_line\": \"lmburns/lf.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+cKAw==\"]], \"py/object\": \"datetime.date\"}}", + "nvim-telescope/telescope-bibtex.nvim": "{\"description\": \"A telescope.nvim extension to search and paste bibtex entries into your TeX files.\", \"homepage\": \"https://github.com/nvim-telescope/telescope-bibtex.nvim\", \"license\": {\"py/reduce\": [{\"py/type\": \"update_vim_plugins.nix.License\"}, {\"py/tuple\": [\"mit\"]}]}, \"name\": \"telescope-bibtex-nvim\", \"owner\": \"nvim-telescope\", \"py/object\": \"update_vim_plugins.plugin.GitHubPlugin\", \"source\": {\"py/object\": \"update_vim_plugins.nix.UrlSource\", \"sha256\": \"1sd6p8cvv3dckgrhc7grlyfcibjxhxbfyh0w7p5m4mdcazhy1kqs\", \"url\": \"https://github.com/nvim-telescope/telescope-bibtex.nvim/archive/289a6f86ebec06e8ae1590533b732b9981d84900.tar.gz\"}, \"source_line\": \"nvim-telescope/telescope-bibtex.nvim\", \"version\": {\"__reduce__\": [{\"py/type\": \"datetime.date\"}, [\"B+gDHA==\"]], \"py/object\": \"datetime.date\"}}" +} \ No newline at end of file diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/blacklist.txt b/pkgs/by-name/vi/vimExtraPlugins/plugins/blacklist.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/plugins/blacklist.txt @@ -0,0 +1 @@ + diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/default.nix b/pkgs/by-name/vi/vimExtraPlugins/plugins/default.nix new file mode 100644 index 00000000..df09e446 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/plugins/default.nix @@ -0,0 +1,55 @@ +{ + lib, + buildVimPlugin, + fetchurl, + fetchgit, +}: { + /* + Generated from: ThePrimeagen/harpoon:master + */ + harpoon = buildVimPlugin { + pname = "harpoon"; + version = "2023-12-26"; + src = fetchurl { + url = "https://github.com/ThePrimeagen/harpoon/archive/ccae1b9bec717ae284906b0bf83d720e59d12b91.tar.gz"; + sha256 = "1w4hi9hbdjwdhb4vwa0x08a25vbcxqg1d5cskm2qvjy5fdlqils0"; + }; + meta = with lib; { + description = ""; + homepage = "https://github.com/ThePrimeagen/harpoon"; + license = with licenses; [mit]; + }; + }; + /* + Generated from: lmburns/lf.nvim + */ + lf-nvim = buildVimPlugin { + pname = "lf-nvim"; + version = "2023-10-03"; + src = fetchurl { + url = "https://github.com/lmburns/lf.nvim/archive/69ab1efcffee6928bf68ac9bd0c016464d9b2c8b.tar.gz"; + sha256 = "1nwf90bnzqhlgs007gg6xpx0vf4r1d19586nld78ipi1ch7nz4px"; + }; + meta = with lib; { + description = "Lf file manager for Neovim (in Lua)"; + homepage = "https://github.com/lmburns/lf.nvim"; + license = with licenses; [mit]; + }; + }; + /* + Generated from: nvim-telescope/telescope-bibtex.nvim + */ + telescope-bibtex-nvim = buildVimPlugin { + pname = "telescope-bibtex-nvim"; + version = "2024-03-28"; + src = fetchurl { + url = "https://github.com/nvim-telescope/telescope-bibtex.nvim/archive/289a6f86ebec06e8ae1590533b732b9981d84900.tar.gz"; + sha256 = "1sd6p8cvv3dckgrhc7grlyfcibjxhxbfyh0w7p5m4mdcazhy1kqs"; + }; + meta = with lib; { + description = "A telescope.nvim extension to search and paste bibtex entries into your TeX files."; + homepage = "https://github.com/nvim-telescope/telescope-bibtex.nvim"; + license = with licenses; [mit]; + }; + }; +} diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/manifest.txt b/pkgs/by-name/vi/vimExtraPlugins/plugins/manifest.txt new file mode 100644 index 00000000..615083c8 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/plugins/manifest.txt @@ -0,0 +1,3 @@ +lmburns/lf.nvim +nvim-telescope/telescope-bibtex.nvim +ThePrimeagen/harpoon:master diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md b/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md new file mode 100644 index 00000000..4f73f811 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/plugins/plugins.md @@ -0,0 +1,7 @@ +- Plugin count: 3 + +| Repo | Last Update | Nix package name | Last checked | +|:---|:---|:---|:---| +| [ThePrimeagen/harpoon:master](https://github.com/ThePrimeagen/harpoon) | 2023-12-26 | `harpoon` | 2024-05-09 | +| [lmburns/lf.nvim](https://github.com/lmburns/lf.nvim) | 2023-10-03 | `lf-nvim` | 2024-05-09 | +| [nvim-telescope/telescope-bibtex.nvim](https://github.com/nvim-telescope/telescope-bibtex.nvim) | 2024-03-28 | `telescope-bibtex-nvim` | 2024-05-09 | diff --git a/pkgs/by-name/vi/vimExtraPlugins/plugins/whitelist.txt b/pkgs/by-name/vi/vimExtraPlugins/plugins/whitelist.txt new file mode 100644 index 00000000..e69de29b diff --git a/pkgs/by-name/vi/vimExtraPlugins/update.sh b/pkgs/by-name/vi/vimExtraPlugins/update.sh new file mode 100755 index 00000000..6a0d3452 --- /dev/null +++ b/pkgs/by-name/vi/vimExtraPlugins/update.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +BASE_DIR="$(readlink -f "$(dirname "$0")/plugins")" + +# Fetch plugins +cd "$BASE_DIR" || (echo "BUG: No '$BASE_DIR'" && exit 1) + +# Cleanup manifest +sort -o "$BASE_DIR/manifest.txt" "$BASE_DIR/manifest.txt" +sort -o "$BASE_DIR/blacklist.txt" "$BASE_DIR/blacklist.txt" +## Remove all plugins, which are on the blacklist +# The same file is read and written to +# shellcheck disable=SC2005 +echo "$(comm -23 "$BASE_DIR/manifest.txt" "$BASE_DIR/blacklist.txt")" >"$BASE_DIR/manifest.txt" + +# Backup vim-plugins.nix +mv "$BASE_DIR/default.nix" "$BASE_DIR/default.nix.bak" +echo "{...} : {}" >"$BASE_DIR/default.nix" + +# Generate derivations for new plugins (this binary is provided by the dev-environment) +update-vim-plugins cleanup "$BASE_DIR" + +# Restore vim-plugins.nix +mv "$BASE_DIR/default.nix.bak" "$BASE_DIR/default.nix" + +# Update new plugins +update-vim-plugins update "$BASE_DIR" --all -- cgit 1.4.1