summary refs log tree commit diff
path: root/pkgs/applications/editors/vim/plugins/updater.nix
blob: afa245d9be9e4079263c3f5425d734db3e510ccf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ buildPythonApplication
, nix
, makeWrapper
, python3Packages
, lib
, nix-prefetch-git
, nurl

# optional
, vimPlugins
, neovim
}:
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 nix-prefetch-git neovim nurl ]}" --prefix PYTHONPATH : "$out/lib" )
    wrapPythonPrograms
  '';

  meta.mainProgram = "vim-plugins-updater";
}