[feat] nvim: add custom vim plugin management

Use vimPluginsUpdater to keep extra plugins up to date

Fixes #4
This commit is contained in:
Jalil David Salamé Messina 2024-08-10 14:38:01 +02:00
parent 52407688d0
commit a4277829ad
Signed by: jalil
GPG key ID: F016B9E770737A0B
6 changed files with 65 additions and 22 deletions

View file

@ -11,6 +11,25 @@ build-vm:
run-vm: build-vm
QEMU_OPTS="$QEMU_OPTS_WL" result/bin/run-nixos-vm
update-vim-plugins:
#!/bin/sh
# Use local nixpkgs if available
nixpkgs="$HOME/Dev/nixpkgs"
# copy nixpkgs from local checkout
if [ ! -d "$nixpkgs" ]; then
nixpkgs="$(mktemp -d)"
cp -r /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/. "$nixpkgs"
cd "$nixpkgs"
git init .
git add .
git commit -m 'dummy commit'
cd -
fi
# update vim plugins
nix run nixpkgs#vimPluginsUpdater -- --nixpkgs "$nixpkgs" --no-commit -i ./nvim/extraPlugins/plugins -o ./nvim/extraPlugins/generated.nix update
# format the generated output
nix fmt ./nvim/extraPlugins/generated.nix
# Amend Update flake.lock PR
flake-pr:
git branch -D update_flake_lock_action || echo "no previous update branch"

View file

@ -1,5 +1,11 @@
{ pkgs }:
let
overlay = pkgs.callPackage ./generated.nix {
inherit (pkgs.vimUtils) buildVimPlugin buildNeovimPlugin;
};
plugins = overlay pkgs pkgs;
in
{
vim-jjdescription = pkgs.callPackage ./vim-jjdescription.nix { };
nvim-silicon = pkgs.callPackage ./nvim-silicon.nix { };
inherit overlay;
inherit (plugins) vim-jjdescription nvim-silicon;
}

View file

@ -0,0 +1,35 @@
# GENERATED by ./pkgs/applications/editors/vim/plugins/update.py. Do not edit!
{
lib,
buildVimPlugin,
buildNeovimPlugin,
fetchFromGitHub,
fetchgit,
}:
final: prev: {
nvim-silicon = buildVimPlugin {
pname = "nvim-silicon";
version = "2024-07-30";
src = fetchFromGitHub {
owner = "michaelrommel";
repo = "nvim-silicon";
rev = "feb882f04c992b797daa118101a239fb3bedfc04";
sha256 = "03dy4q2dbgiyydi9wvpij6s2aggdpr3lgd9cqqv0i2m1m0qb9gad";
};
meta.homepage = "https://github.com/michaelrommel/nvim-silicon/";
};
vim-jjdescription = buildVimPlugin {
pname = "vim-jjdescription";
version = "2024-05-28";
src = fetchFromGitHub {
owner = "avm99963";
repo = "vim-jjdescription";
rev = "ca14325202f3cd894d01ba833451017624249222";
sha256 = "1y83fdih991ivlvgcwp0sx97icmf9k6px7mr26vb77izjlf011w2";
};
meta.homepage = "https://github.com/avm99963/vim-jjdescription/";
};
}

View file

@ -1,10 +0,0 @@
{ vimUtils, fetchFromGitHub }:
vimUtils.buildVimPlugin {
name = "nvim-silicon";
src = fetchFromGitHub {
owner = "michaelrommel";
repo = "nvim-silicon";
rev = "v1.0.0";
hash = "sha256-cZOzgzLUNC9qOS2m/rc6YJfpNGdRTSCAdEPQDy+wT6I=";
};
}

View file

@ -0,0 +1,3 @@
repo,branch,alias
https://github.com/michaelrommel/nvim-silicon/,,
https://github.com/avm99963/vim-jjdescription/,,

View file

@ -1,10 +0,0 @@
{ vimUtils, fetchFromGitHub }:
vimUtils.buildVimPlugin {
name = "jjdescription";
src = fetchFromGitHub {
owner = "avm99963";
repo = "vim-jjdescription";
rev = "c9bf9f849ead3961ae38ab33f68306996e64c6e8";
hash = "sha256-qnZFuXbzpm2GN/+CfksFfW2O+qTosUZcUagqCTzmtWo=";
};
}