@@ -0,0 +1,40 @@
1+{ stdenvNoCC, lib, fetchFromGitHub, installShellFiles }:
2+stdenvNoCC.mkDerivation rec {
3+ pname = "zplugin";
4+ version = "2.3";
5+ src = fetchFromGitHub {
6+ owner = "zdharma";
7+ repo = pname;
8+ rev = "v${version}";
9+ sha256 = "0qqv5p19s8jb06d6h55dm4acji9x2rpxb2ni3h7fb0q43iz6y85w";
10+ };
11+ # adapted from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=zsh-zplugin-git
12+ dontBuild = true;
13+ nativeBuildInputs = [ installShellFiles ];
14+ installPhase = ''
15+ outdir="$out/share/$pname"
16+
17+ cd "$src"
18+
19+ # Zplugin's source files
20+ install -dm0755 "$outdir"
21+ install -m0644 zplugin{,-side,-install,-autoload}.zsh "$outdir"
22+ install -m0755 git-process-output.zsh "$outdir"
23+
24+ # Zplugin autocompletion
25+ installShellCompletion --zsh _zplugin
26+
27+ #TODO:Zplugin-module files
28+ # find zmodules/ -type d -exec install -dm 755 "{}" "$outdir/{}" \;
29+ # find zmodules/ -type f -exec install -m 744 "{}" "$outdir/{}" \;
30+
31+ '';
32+ #TODO:doc output
33+
34+ meta = with lib; {
35+ homepage = "https://github.com/zdharma/zplugin";
36+ description = "Flexible zsh plugin manager";
37+ license = licenses.mit;
38+ maintainers = with maintainers; [ pasqui23 ];
39+ };
40+}