2017-05-05 01:00:40 +00:00
|
|
|
# zsh-git-prompt -- Informative git prompt for zsh
|
|
|
|
#
|
|
|
|
# Usage: to enable this plugin for all users, you could
|
|
|
|
# add it to configuration.nix like this:
|
|
|
|
#
|
|
|
|
# programs.zsh.interactiveShellInit = ''
|
|
|
|
# source ${pkgs.zsh-git-prompt}/share/zsh-git-prompt/zshrc.sh
|
|
|
|
# '';
|
|
|
|
#
|
|
|
|
# Or you can install it globally but only enable it in individual
|
|
|
|
# users' ~/.zshrc files:
|
|
|
|
#
|
|
|
|
# source /run/current-system/sw/share/zsh-git-prompt/zshrc.sh
|
|
|
|
#
|
|
|
|
# Or if installed locally:
|
|
|
|
#
|
|
|
|
# source ~/.nix-profile/share/zsh-git-prompt/zshrc.sh
|
|
|
|
#
|
|
|
|
# Either way, you then have to set a prompt that incorporates
|
|
|
|
# git_super_status, for example:
|
|
|
|
#
|
|
|
|
# PROMPT='%B%m%~%b$(git_super_status) %# '
|
|
|
|
#
|
|
|
|
# More details are in share/doc/zsh-git-prompt/README.md, once
|
|
|
|
# installed.
|
|
|
|
#
|
2019-03-08 21:14:14 +00:00
|
|
|
{ fetchFromGitHub
|
2022-12-02 21:03:42 +00:00
|
|
|
, python3
|
2017-05-05 01:00:40 +00:00
|
|
|
, git
|
|
|
|
, lib
|
2018-11-02 19:16:56 +00:00
|
|
|
, haskellPackages
|
2017-05-05 01:00:40 +00:00
|
|
|
}:
|
|
|
|
|
2018-11-02 19:16:56 +00:00
|
|
|
haskellPackages.callPackage
|
2021-01-25 08:26:54 +00:00
|
|
|
({ mkDerivation, base, HUnit, parsec, process, QuickCheck }:
|
2017-05-05 01:00:40 +00:00
|
|
|
mkDerivation rec {
|
|
|
|
pname = "zsh-git-prompt";
|
2019-03-08 21:14:14 +00:00
|
|
|
version = "0.4z"; # While we await a real 0.5 release.
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "starcraftman";
|
|
|
|
repo = "zsh-git-prompt";
|
2019-03-06 22:22:20 +00:00
|
|
|
rev = "11b83ba3b85d14c66cf2ab79faefab6d838da28e";
|
|
|
|
sha256 = "04aylsjfb03ckw219plkzpyiq4j9g66bjxa5pa56h1p7df6pjssb";
|
2017-05-05 01:00:40 +00:00
|
|
|
};
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace zshrc.sh \
|
|
|
|
--replace ':-"python"' ':-"haskell"' \
|
2022-12-02 21:03:42 +00:00
|
|
|
--replace 'python ' '${python3.interpreter} ' \
|
2017-05-05 01:00:40 +00:00
|
|
|
--replace 'git ' '${git}/bin/git '
|
|
|
|
'';
|
|
|
|
preCompileBuildDriver = "cd src";
|
|
|
|
postInstall = ''
|
|
|
|
cd ..
|
|
|
|
gpshare=$out/share/${pname}
|
|
|
|
gpdoc=$out/share/doc/${pname}
|
|
|
|
mkdir -p $gpshare/src $gpdoc
|
|
|
|
cp README.md $gpdoc
|
|
|
|
cp zshrc.sh gitstatus.py $gpshare
|
|
|
|
mv $out/bin $gpshare/src/.bin
|
|
|
|
'';
|
|
|
|
isLibrary = false;
|
|
|
|
isExecutable = true;
|
|
|
|
libraryHaskellDepends = [ base parsec process QuickCheck ];
|
|
|
|
executableHaskellDepends = libraryHaskellDepends;
|
|
|
|
testHaskellDepends = [HUnit] ++ libraryHaskellDepends;
|
2019-04-22 08:14:28 +00:00
|
|
|
homepage = "https://github.com/olivierverdier/zsh-git-prompt#readme";
|
2017-05-05 01:00:40 +00:00
|
|
|
description = "Informative git prompt for zsh";
|
2021-01-15 06:28:56 +00:00
|
|
|
license = lib.licenses.mit;
|
2017-05-05 01:00:40 +00:00
|
|
|
maintainers = [lib.maintainers.league];
|
|
|
|
}) {}
|