summary refs log tree commit diff
path: root/pkgs/shells/zsh/zsh-git-prompt
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-04-17 14:03:07 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-04-17 14:47:32 -0500
commitddaea6ac77177c91576568af4b6f6d85195559af (patch)
tree0292a346327a613a52b95492aea9ed76d8c55dfe /pkgs/shells/zsh/zsh-git-prompt
parentd308ac923376b76183a0b4078f808ce40af8f86b (diff)
downloadnixlib-ddaea6ac77177c91576568af4b6f6d85195559af.tar
nixlib-ddaea6ac77177c91576568af4b6f6d85195559af.tar.gz
nixlib-ddaea6ac77177c91576568af4b6f6d85195559af.tar.bz2
nixlib-ddaea6ac77177c91576568af4b6f6d85195559af.tar.lz
nixlib-ddaea6ac77177c91576568af4b6f6d85195559af.tar.xz
nixlib-ddaea6ac77177c91576568af4b6f6d85195559af.tar.zst
nixlib-ddaea6ac77177c91576568af4b6f6d85195559af.zip
pkgs/shells: move extensions to subdirs
These are not reaal shells and should go into their parent shell
directory.
Diffstat (limited to 'pkgs/shells/zsh/zsh-git-prompt')
-rw-r--r--pkgs/shells/zsh/zsh-git-prompt/default.nix70
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/shells/zsh/zsh-git-prompt/default.nix b/pkgs/shells/zsh/zsh-git-prompt/default.nix
new file mode 100644
index 000000000000..7318da83d176
--- /dev/null
+++ b/pkgs/shells/zsh/zsh-git-prompt/default.nix
@@ -0,0 +1,70 @@
+# 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.
+#
+{ fetchgit
+, haskell
+, python
+, git
+, lib
+, ghcVersion ? "ghc802"
+}:
+
+haskell.packages.${ghcVersion}.callPackage
+  ({ mkDerivation, base, HUnit, parsec, process, QuickCheck, stdenv }:
+   mkDerivation rec {
+     pname = "zsh-git-prompt";
+     version = "0.5";
+     src = fetchgit {
+       url = "https://github.com/olivierverdier/zsh-git-prompt.git";
+       rev = "0a6c8b610e799040b612db8888945f502a2ddd9d";
+       sha256 = "19x1gf1r6l7r6i7vhhsgzcbdlnr648jx8j84nk2zv1b8igh205hw";
+     };
+     prePatch = ''
+        substituteInPlace zshrc.sh                       \
+          --replace ':-"python"' ':-"haskell"'           \
+          --replace 'python '    '${python.interpreter} ' \
+          --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;
+     homepage = "http://github.com/olivierverdier/zsh-git-prompt#readme";
+     description = "Informative git prompt for zsh";
+     license = stdenv.lib.licenses.mit;
+     maintainers = [lib.maintainers.league];
+   }) {}