summary refs log tree commit diff
path: root/pkgs/applications/editors/vim/plugins/updater.nix
blob: d17247b3f8afe67dc42ab32d2e80994d15b8aa4a (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
45
46
47
48
{ buildPythonApplication
, nix
, makeWrapper
, python3Packages
, lib
, nix-prefetch-git

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

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