about summary refs log tree commit diff stats
path: root/pkgs/by-name/vi
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-23 13:26:22 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-23 13:26:22 +0200
commit204731c0a69136c9cebcb54f1afecf5145e26bbe (patch)
treefc9132e5dc74e4a8e1327cdd411839a90f9410aa /pkgs/by-name/vi
parentrefactor(sys): Modularize and move to `modules/system` or `pkgs` (diff)
downloadnixos-config-204731c0a69136c9cebcb54f1afecf5145e26bbe.tar.gz
nixos-config-204731c0a69136c9cebcb54f1afecf5145e26bbe.zip
refactor(pkgs): Categorize into `by-name` shards
This might not be the perfect way to organize a package set --
especially if the set is not nearly the size of nixpkgs -- but it is
_at_ least a way of organization.
Diffstat (limited to 'pkgs/by-name/vi')
-rw-r--r--pkgs/by-name/vi/vim-plugins/README.md92
-rw-r--r--pkgs/by-name/vi/vim-plugins/check.nix37
-rw-r--r--pkgs/by-name/vi/vim-plugins/overrides.nix34
-rw-r--r--pkgs/by-name/vi/vim-plugins/package.nix19
-rw-r--r--pkgs/by-name/vi/vim-plugins/plugins/.plugins.json7
-rw-r--r--pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt1
-rw-r--r--pkgs/by-name/vi/vim-plugins/plugins/default.nix55
-rw-r--r--pkgs/by-name/vi/vim-plugins/plugins/manifest.txt3
-rw-r--r--pkgs/by-name/vi/vim-plugins/plugins/plugins.md7
-rw-r--r--pkgs/by-name/vi/vim-plugins/plugins/whitelist.txt0
-rwxr-xr-xpkgs/by-name/vi/vim-plugins/update.sh27
-rw-r--r--pkgs/by-name/vi/virsh-del/package.nix13
-rwxr-xr-xpkgs/by-name/vi/virsh-del/virsh-del.sh10
13 files changed, 305 insertions, 0 deletions
diff --git a/pkgs/by-name/vi/vim-plugins/README.md b/pkgs/by-name/vi/vim-plugins/README.md
new file mode 100644
index 00000000..e8169951
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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/vim-plugins/check.nix b/pkgs/by-name/vi/vim-plugins/check.nix
new file mode 100644
index 00000000..ad23e2c7
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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/vim-plugins/overrides.nix b/pkgs/by-name/vi/vim-plugins/overrides.nix
new file mode 100644
index 00000000..e03a78b1
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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;};
+      }))
+    {
+      # <name> = 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 = [<licenses>]
+      */
+    });
+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
new file mode 100644
index 00000000..e2e4a117
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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/vim-plugins/plugins/.plugins.json b/pkgs/by-name/vi/vim-plugins/plugins/.plugins.json
new file mode 100644
index 00000000..9331bc8f
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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/vim-plugins/plugins/blacklist.txt b/pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/plugins/blacklist.txt
@@ -0,0 +1 @@
+
diff --git a/pkgs/by-name/vi/vim-plugins/plugins/default.nix b/pkgs/by-name/vi/vim-plugins/plugins/default.nix
new file mode 100644
index 00000000..df09e446
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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/vim-plugins/plugins/manifest.txt b/pkgs/by-name/vi/vim-plugins/plugins/manifest.txt
new file mode 100644
index 00000000..615083c8
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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/vim-plugins/plugins/plugins.md b/pkgs/by-name/vi/vim-plugins/plugins/plugins.md
new file mode 100644
index 00000000..4f73f811
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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/vim-plugins/plugins/whitelist.txt b/pkgs/by-name/vi/vim-plugins/plugins/whitelist.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/plugins/whitelist.txt
diff --git a/pkgs/by-name/vi/vim-plugins/update.sh b/pkgs/by-name/vi/vim-plugins/update.sh
new file mode 100755
index 00000000..6a0d3452
--- /dev/null
+++ b/pkgs/by-name/vi/vim-plugins/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
diff --git a/pkgs/by-name/vi/virsh-del/package.nix b/pkgs/by-name/vi/virsh-del/package.nix
new file mode 100644
index 00000000..3f27e2be
--- /dev/null
+++ b/pkgs/by-name/vi/virsh-del/package.nix
@@ -0,0 +1,13 @@
+{
+  sysLib,
+  libvirt,
+}:
+sysLib.writeShellScript {
+  name = "virsh-del";
+  src = ./virsh-del.sh;
+  generateCompletions = false;
+  keepPath = false;
+  dependencies = [
+    libvirt
+  ];
+}
diff --git a/pkgs/by-name/vi/virsh-del/virsh-del.sh b/pkgs/by-name/vi/virsh-del/virsh-del.sh
new file mode 100755
index 00000000..c3de5484
--- /dev/null
+++ b/pkgs/by-name/vi/virsh-del/virsh-del.sh
@@ -0,0 +1,10 @@
+#! /usr/bin/env dash
+
+# shellcheck source=/dev/null
+SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
+
+virsh destroy "$1"
+virsh undefine "$1" --nvram
+virsh vol-delete --pool default "$1".qcow2
+
+# vim: ft=sh