mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00

The nixpkgs documentation mentions how to update out of tree plugins but one problem is that it requires a nixpkgs clone. This makes it more convenient. I've had the need to generate vim plugins and lua overlays for other projects unrelated to nix and this will make updates easier (aka just run `nix run nixpkgs#vimPluginsUpdater -- --proc=1` or with the legacy commands: `nix-shell -p vimPluginsUpdater --run vim-plugins-updater`. I added an optional "nixpkgs" argument to command line parser, which is the path towards a nixpkgs checkout. By default the current folder. update-luarocks-packages: format with black
47 lines
983 B
Nix
47 lines
983 B
Nix
{ buildPythonApplication
|
|
, nix
|
|
, makeWrapper
|
|
, python3Packages
|
|
, lib
|
|
|
|
# optional
|
|
, vimPlugins
|
|
, neovim
|
|
}:
|
|
let
|
|
my_neovim = neovim.override {
|
|
configure.packages.all.start = [ vimPlugins.nvim-treesitter ];
|
|
};
|
|
|
|
in
|
|
buildPythonApplication {
|
|
format = "other";
|
|
pname = "vim-plugins-updater";
|
|
version = "0.1";
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
python3Packages.wrapPython
|
|
];
|
|
|
|
pythonPath = [
|
|
python3Packages.gitpython
|
|
];
|
|
|
|
dontUnpack = true;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin $out/lib
|
|
cp ${./update.py} $out/bin/vim-plugins-updater
|
|
cp ${./get-plugins.nix} $out/get-plugins.nix
|
|
cp ${./nvim-treesitter/update.py} $out/lib/treesitter.py
|
|
cp ${../../../../../maintainers/scripts/pluginupdate.py} $out/lib/pluginupdate.py
|
|
|
|
# wrap python scripts
|
|
makeWrapperArgs+=( --prefix PATH : "${lib.makeBinPath [ nix my_neovim ]}" --prefix PYTHONPATH : "$out/lib" )
|
|
wrapPythonPrograms
|
|
'';
|
|
|
|
meta.mainProgram = "vim-plugins-updater";
|
|
}
|
|
|