nixpkgs/pkgs/shells/zsh/zinit/default.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

2020-06-14 12:28:27 +01:00
{ stdenvNoCC, lib, fetchFromGitHub, installShellFiles }:
2021-01-29 23:56:55 +00:00
2020-06-14 12:28:27 +01:00
stdenvNoCC.mkDerivation rec {
2021-01-29 23:56:55 +00:00
pname = "zinit";
version = "3.7";
2020-06-14 12:28:27 +01:00
src = fetchFromGitHub {
owner = "zdharma";
repo = pname;
rev = "v${version}";
2021-01-29 23:56:55 +00:00
hash = "sha256-B+cTGz+U8MR22l6xXdRAAjDr+ulCk+CJ9GllFMK0axE=";
2020-06-14 12:28:27 +01:00
};
# adapted from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=zsh-zplugin-git
dontBuild = true;
nativeBuildInputs = [ installShellFiles ];
installPhase = ''
outdir="$out/share/$pname"
cd "$src"
# Zplugin's source files
install -dm0755 "$outdir"
2021-01-29 23:56:55 +00:00
# Installing also backward compatibility layer
install -m0644 z{plugin,init}{,-side,-install,-autoload}.zsh "$outdir"
2020-06-14 12:28:27 +01:00
install -m0755 git-process-output.zsh "$outdir"
# Zplugin autocompletion
2021-01-29 23:56:55 +00:00
installShellCompletion --zsh _zinit
2020-06-14 12:28:27 +01:00
#TODO:Zplugin-module files
# find zmodules/ -type d -exec install -dm 755 "{}" "$outdir/{}" \;
# find zmodules/ -type f -exec install -m 744 "{}" "$outdir/{}" \;
'';
#TODO:doc output
meta = with lib; {
2021-01-29 23:56:55 +00:00
homepage = "https://github.com/zdharma/zinit";
2020-06-14 12:28:27 +01:00
description = "Flexible zsh plugin manager";
license = licenses.mit;
maintainers = with maintainers; [ pasqui23 ];
};
}