From b6302ae731f9d438f4e59f62d04903df79d4c942 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 9 Dec 2023 18:20:18 +0100 Subject: feat(treewide): Specify nvim plugins in my flake --- sys/nixpkgs/pkgs/plgs-pkgs/update_neovim_plugins | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 sys/nixpkgs/pkgs/plgs-pkgs/update_neovim_plugins (limited to 'sys/nixpkgs/pkgs/plgs-pkgs/update_neovim_plugins') diff --git a/sys/nixpkgs/pkgs/plgs-pkgs/update_neovim_plugins b/sys/nixpkgs/pkgs/plgs-pkgs/update_neovim_plugins new file mode 100755 index 00000000..ea71c6fa --- /dev/null +++ b/sys/nixpkgs/pkgs/plgs-pkgs/update_neovim_plugins @@ -0,0 +1,26 @@ +#!/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 +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