diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-04-17 14:03:07 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2018-04-17 14:47:32 -0500 |
commit | ddaea6ac77177c91576568af4b6f6d85195559af (patch) | |
tree | 0292a346327a613a52b95492aea9ed76d8c55dfe /pkgs/shells/zsh | |
parent | d308ac923376b76183a0b4078f808ce40af8f86b (diff) | |
download | nixlib-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')
-rw-r--r-- | pkgs/shells/zsh/antigen/default.nix | 25 | ||||
-rw-r--r-- | pkgs/shells/zsh/grml-zsh-config/default.nix | 41 | ||||
-rw-r--r-- | pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix | 25 | ||||
-rw-r--r-- | pkgs/shells/zsh/nix-zsh-completions/default.nix | 29 | ||||
-rw-r--r-- | pkgs/shells/zsh/oh-my-zsh/default.nix | 74 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-autosuggestions/default.nix | 30 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-command-time/default.nix | 31 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-completions/default.nix | 26 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-deer/default.nix | 35 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-deer/realpath.patch | 28 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-git-prompt/default.nix | 70 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-powerlevel9k/default.nix | 29 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-prezto/default.nix | 30 | ||||
-rw-r--r-- | pkgs/shells/zsh/zsh-syntax-highlighting/default.nix | 27 |
14 files changed, 500 insertions, 0 deletions
diff --git a/pkgs/shells/zsh/antigen/default.nix b/pkgs/shells/zsh/antigen/default.nix new file mode 100644 index 000000000000..cf22207ef09c --- /dev/null +++ b/pkgs/shells/zsh/antigen/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + version = "2.2.3"; + name = "antigen-${version}"; + + src = fetchurl { + url = "https://github.com/zsh-users/antigen/releases/download/v${version}/antigen.zsh"; + sha256 = "1bmp3qf14509swpxin4j9f98n05pdilzapjm0jdzbv0dy3hn20ix"; + }; + + phases = "installPhase"; + + installPhase = '' + outdir=$out/share/antigen + mkdir -p $outdir + cp $src $outdir/antigen.zsh + ''; + + meta = { + description = "The plugin manager for zsh."; + homepage = http://antigen.sharats.me; + license = stdenv.lib.licenses.mit; + }; +} diff --git a/pkgs/shells/zsh/grml-zsh-config/default.nix b/pkgs/shells/zsh/grml-zsh-config/default.nix new file mode 100644 index 000000000000..e516393a23ca --- /dev/null +++ b/pkgs/shells/zsh/grml-zsh-config/default.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, lib +, zsh, coreutils, inetutils, procps, txt2tags }: + +with lib; + +stdenv.mkDerivation rec { + name = "grml-zsh-config-${version}"; + version = "0.14.3"; + + src = fetchFromGitHub { + owner = "grml"; + repo = "grml-etc-core"; + rev = "v${version}"; + sha256 = "1akx6lwxnbcccddzw41rci8rb9n5vb6q2vpn5qr07f0grchyiifk"; + }; + + buildInputs = [ zsh coreutils txt2tags procps ] + ++ optional stdenv.isLinux [ inetutils ]; + + buildPhase = '' + cd doc + make + cd .. + ''; + + installPhase = '' + install -D -m644 etc/zsh/keephack $out/etc/zsh/keephack + install -D -m644 etc/zsh/zshrc $out/etc/zsh/zshrc + + install -D -m644 doc/grmlzshrc.5 $out/share/man/man5/grmlzshrc.5 + ln -s grmlzshrc.5.gz $out/share/man/man5/grml-zsh-config.5.gz + ''; + + meta = with stdenv.lib; { + description = "grml's zsh setup"; + homepage = http://grml.org/zsh/; + license = licenses.gpl2; + platforms = platforms.unix; + maintainers = with maintainers; [ msteen rvolosatovs ]; + }; +} diff --git a/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix b/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix new file mode 100644 index 000000000000..6dea51a487e9 --- /dev/null +++ b/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation { + name = "lambda-mod-zsh-theme-unstable-2017-10-08"; + + src = fetchFromGitHub { + owner = "halfo"; + repo = "lambda-mod-zsh-theme"; + sha256 = "13yis07zyr192s0x2h04k5bm1yzbk5m3js83aa17xh5573w4b786"; + rev = "61c373c8aa5556d51522290b82ad44e7166bced1"; + }; + + installPhase = '' + mkdir -p $out/share/themes + cp lambda-mod.zsh-theme $out/share/themes + ''; + + meta = with stdenv.lib; { + description = "A ZSH theme optimized for people who use Git & Unicode-compatible fonts and terminals"; + homepage = https://github.com/halfo/lambda-mod-zsh-theme/; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ ma27 ]; + }; +} diff --git a/pkgs/shells/zsh/nix-zsh-completions/default.nix b/pkgs/shells/zsh/nix-zsh-completions/default.nix new file mode 100644 index 000000000000..2bcff6b809dc --- /dev/null +++ b/pkgs/shells/zsh/nix-zsh-completions/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub }: + +let + version = "0.3.8"; +in + +stdenv.mkDerivation rec { + name = "nix-zsh-completions-${version}"; + + src = fetchFromGitHub { + owner = "spwhitt"; + repo = "nix-zsh-completions"; + rev = "${version}"; + sha256 = "05ynd38br2kn657g7l01jg1q8ja9xwrdyb95w02gh7j9cww2k06w"; + }; + + installPhase = '' + mkdir -p $out/share/zsh/site-functions + cp _* $out/share/zsh/site-functions + ''; + + meta = { + homepage = https://github.com/spwhitt/nix-zsh-completions; + description = "ZSH completions for Nix, NixOS, and NixOps"; + license = stdenv.lib.licenses.bsd3; + platforms = stdenv.lib.platforms.all; + maintainers = [ stdenv.lib.maintainers.spwhitt stdenv.lib.maintainers.olejorgenb stdenv.lib.maintainers.hedning ]; + }; +} diff --git a/pkgs/shells/zsh/oh-my-zsh/default.nix b/pkgs/shells/zsh/oh-my-zsh/default.nix new file mode 100644 index 000000000000..5412f4ce8967 --- /dev/null +++ b/pkgs/shells/zsh/oh-my-zsh/default.nix @@ -0,0 +1,74 @@ +# This script was inspired by the ArchLinux User Repository package: +# +# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=oh-my-zsh-git +{ stdenv, fetchgit }: + +stdenv.mkDerivation rec { + version = "2018-04-06"; + name = "oh-my-zsh-${version}"; + + src = fetchgit { + url = "https://github.com/robbyrussell/oh-my-zsh"; + rev = "62b8a70a7c5d0c939d8dabfef48796a092d1a55f"; + sha256 = "02na47pa2ly17yvwa2nhzyrp8iarawyirhfw3779sh0w78vgw1gs"; + }; + + pathsToLink = [ "/share/oh-my-zsh" ]; + + phases = "installPhase"; + + installPhase = '' + outdir=$out/share/oh-my-zsh + template=templates/zshrc.zsh-template + + mkdir -p $outdir + cp -r $src/* $outdir + cd $outdir + + rm LICENSE.txt + rm -rf .git* + + chmod -R +w templates + + # Change the path to oh-my-zsh dir and disable auto-updating. + sed -i -e "s#ZSH=\$HOME/.oh-my-zsh#ZSH=$outdir#" \ + -e 's/\# \(DISABLE_AUTO_UPDATE="true"\)/\1/' \ + $template + + # Look for .zsh_variables, .zsh_aliases, and .zsh_funcs, and source + # them, if found. + cat >> $template <<- EOF + + # Load the variables. + if [ -f ~/.zsh_variables ]; then + . ~/.zsh_variables + fi + + # Load the functions. + if [ -f ~/.zsh_funcs ]; then + . ~/.zsh_funcs + fi + + # Load the aliases. + if [ -f ~/.zsh_aliases ]; then + . ~/.zsh_aliases + fi + EOF + ''; + + meta = with stdenv.lib; { + description = "A framework for managing your zsh configuration"; + longDescription = '' + Oh My Zsh is a framework for managing your zsh configuration. + + To copy the Oh My Zsh configuration file to your home directory, run + the following command: + + $ cp -v $(nix-env -q --out-path oh-my-zsh | cut -d' ' -f3)/share/oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc + ''; + homepage = "http://ohmyz.sh/"; + license = licenses.mit; + platforms = platforms.all; + maintainers = with maintainers; [ scolobb nequissimus ]; + }; +} diff --git a/pkgs/shells/zsh/zsh-autosuggestions/default.nix b/pkgs/shells/zsh/zsh-autosuggestions/default.nix new file mode 100644 index 000000000000..906301110e96 --- /dev/null +++ b/pkgs/shells/zsh/zsh-autosuggestions/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub, zsh }: + +# To make use of this derivation, use the `programs.zsh.enableAutoSuggestions` option + +stdenv.mkDerivation rec { + name = "zsh-autosuggestions-${version}"; + version = "0.4.2"; + + src = fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-autosuggestions"; + rev = "v${version}"; + sha256 = "1yvbhfaaqzhmjmwjh75i1p4mrqp3ksw74bp8lrll81c6zf8bmvig"; + }; + + buildInputs = [ zsh ]; + + installPhase = '' + install -D zsh-autosuggestions.zsh \ + $out/share/zsh-autosuggestions/zsh-autosuggestions.zsh + ''; + + meta = with stdenv.lib; { + description = "Fish shell autosuggestions for Zsh"; + homepage = https://github.com/zsh-users/zsh-autosuggestions; + license = licenses.mit; + platforms = platforms.unix; + maintainers = [ maintainers.loskutov ]; + }; +} diff --git a/pkgs/shells/zsh/zsh-command-time/default.nix b/pkgs/shells/zsh/zsh-command-time/default.nix new file mode 100644 index 000000000000..453a57744071 --- /dev/null +++ b/pkgs/shells/zsh/zsh-command-time/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchFromGitHub }: + +# To make use of this plugin, need to add +# programs.zsh.interactiveShellInit = '' +# source ${pkgs.zsh-command-time}/share/zsh-command-time/command-time.plugin.zsh +# ZSH_COMMAND_TIME_MIN_SECONDS=3 +# ZSH_COMMAND_TIME_ECHO=1 +# ''; + +stdenv.mkDerivation rec { + version = "2017-05-09"; + name = "zsh-command-time-${version}"; + + src = fetchFromGitHub { + owner = "popstas"; + repo = "zsh-command-time"; + rev = "2111361cbc88c542c834fbab7802ae5ae8339824"; + sha256 = "0hr9c7196wy9cg7vkmknszr2h446yvg9pqrq0rf3213kz074dhpg"; + }; + + installPhase = '' + install -D $src/command-time.plugin.zsh --target-directory=$out/share/zsh-command-time + ''; + + meta = with stdenv.lib; { + description = "Plugin that output time: xx after long commands"; + homepage = https://github.com/popstas/zsh-command-time; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/pkgs/shells/zsh/zsh-completions/default.nix b/pkgs/shells/zsh/zsh-completions/default.nix new file mode 100644 index 000000000000..92a9d293e84f --- /dev/null +++ b/pkgs/shells/zsh/zsh-completions/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub}: + +stdenv.mkDerivation rec { + name = "zsh-completions-${version}"; + version = "0.27.0"; + + src = fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-completions"; + rev = "${version}"; + sha256 = "1c2xx9bkkvyy0c6aq9vv3fjw7snlm0m5bjygfk5391qgjpvchd29"; + }; + + installPhase= '' + install -D --target-directory=$out/share/zsh/site-functions src/* + ''; + + meta = { + description = "Additional completion definitions for zsh"; + homepage = https://github.com/zsh-users/zsh-completions; + license = stdenv.lib.licenses.free; + + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.olejorgenb ]; + }; +} diff --git a/pkgs/shells/zsh/zsh-deer/default.nix b/pkgs/shells/zsh/zsh-deer/default.nix new file mode 100644 index 000000000000..735d6a2b7619 --- /dev/null +++ b/pkgs/shells/zsh/zsh-deer/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub, perl }: + +let + version = "1.4"; + name = "deer-${version}"; +in stdenv.mkDerivation { + inherit name; + + src = fetchFromGitHub { + owner = "Vifon"; + repo = "deer"; + rev = "v${version}"; + sha256 = "1xnbnbi0zk2xsyn8dqsmyxqlfnl36pb1wwibnlp0dxixw6sfymyl"; + }; + + prePatch = '' + substituteInPlace deer \ + --replace " perl " " ${perl}/bin/perl " + ''; + + patches = [ ./realpath.patch ]; + + installPhase = '' + mkdir -p $out/share/zsh/site-functions/ + cp deer $out/share/zsh/site-functions/ + ''; + + meta = with stdenv.lib; { + description = "Ranger-like file navigation for zsh"; + homepage = "https://github.com/Vifon/deer"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.vyp ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/shells/zsh/zsh-deer/realpath.patch b/pkgs/shells/zsh/zsh-deer/realpath.patch new file mode 100644 index 000000000000..03850d7e5c12 --- /dev/null +++ b/pkgs/shells/zsh/zsh-deer/realpath.patch @@ -0,0 +1,28 @@ +From ceadb2f11119143af4f590ea6b05a531483219b5 Mon Sep 17 00:00:00 2001 +From: xd1le <elisp.vim@gmail.com> +Date: Wed, 30 Aug 2017 17:27:20 +1000 +Subject: [PATCH] use realpath instead of python to calculate relative path + +--- + deer | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/deer b/deer +index 3d89dea..804a871 100644 +--- a/deer ++++ b/deer +@@ -259,10 +259,7 @@ deer-get-relative() + { + local TMP + TMP=${1:-${DEER_DIRNAME%/}/$DEER_BASENAME[$DEER_DIRNAME]} +- TMP="`python -c ' +-import sys, os +-print(os.path.relpath(sys.argv[1], sys.argv[2])) +-' $TMP ${DEER_STARTDIR:-$PWD}`" ++ TMP="`realpath --relative-to=${DEER_STARTDIR:-$PWD} $TMP`" + print -R $TMP:q + } + +-- +2.14.1 + 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]; + }) {} diff --git a/pkgs/shells/zsh/zsh-powerlevel9k/default.nix b/pkgs/shells/zsh/zsh-powerlevel9k/default.nix new file mode 100644 index 000000000000..2babf35f2b68 --- /dev/null +++ b/pkgs/shells/zsh/zsh-powerlevel9k/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub, zsh }: + +# To make use of this derivation, use +# `programs.zsh.promptInit = "source ${pkgs.zsh-powerlevel9k}/share/zsh-powerlevel9k/powerlevel9k.zsh-theme";` + +stdenv.mkDerivation rec { + name = "powerlevel9k-${version}"; + version = "2017-11-10"; + src = fetchFromGitHub { + owner = "bhilburn"; + repo = "powerlevel9k"; + rev = "87acc51acab3ed4fd33cda2386abed6f98c80720"; + sha256 = "0v1dqg9hvycdkcvklg2njff97xwr8rah0nyldv4xm39r77f4yfvq"; + }; + + installPhase= '' + install -D powerlevel9k.zsh-theme --target-directory=$out/share/zsh-powerlevel9k + install -D functions/* --target-directory=$out/share/zsh-powerlevel9k/functions + ''; + + meta = { + description = "A beautiful theme for zsh"; + homepage = https://github.com/bhilburn/powerlevel9k; + license = stdenv.lib.licenses.mit; + + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.pierrechevalier83 ]; + }; +} diff --git a/pkgs/shells/zsh/zsh-prezto/default.nix b/pkgs/shells/zsh/zsh-prezto/default.nix new file mode 100644 index 000000000000..7bef904081e0 --- /dev/null +++ b/pkgs/shells/zsh/zsh-prezto/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchpatch, fetchgit, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "zsh-prezto-2017-12-03"; + src = fetchgit { + url = "https://github.com/sorin-ionescu/prezto"; + rev = "029414581e54f5b63156f81acd0d377e8eb78883"; + sha256 = "0crrj2nq0wcv5in8qimnkca2an760aqald13vq09s5kbwwc9rs1f"; + fetchSubmodules = true; + }; + buildPhase = '' + sed -i -e "s|\''${ZDOTDIR:\-\$HOME}/.zpreztorc|/etc/zpreztorc|g" init.zsh + sed -i -e "s|\''${ZDOTDIR:\-\$HOME}/.zprezto/|$out/|g" init.zsh + for i in runcoms/*; do + sed -i -e "s|\''${ZDOTDIR:\-\$HOME}/.zprezto/|$out/|g" $i + done + sed -i -e "s|\''${0:h}/cache.zsh|\''${ZDOTDIR:\-\$HOME}/.zfasd_cache|g" modules/fasd/init.zsh + ''; + installPhase = '' + mkdir -p $out + cp ./* $out/ -R + ''; + meta = with stdenv.lib; { + description = "Prezto is the configuration framework for Zsh; it enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes."; + homepage = https://github.com/sorin-ionescu/prezto; + license = licenses.mit; + maintainers = with maintainers; [ garbas ]; + platforms = with platforms; unix; + }; +} diff --git a/pkgs/shells/zsh/zsh-syntax-highlighting/default.nix b/pkgs/shells/zsh/zsh-syntax-highlighting/default.nix new file mode 100644 index 000000000000..b7b44098fd7a --- /dev/null +++ b/pkgs/shells/zsh/zsh-syntax-highlighting/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchFromGitHub, zsh }: + +# To make use of this derivation, use the `programs.zsh.enableSyntaxHighlighting` option + +stdenv.mkDerivation rec { + version = "0.6.0"; + name = "zsh-syntax-highlighting-${version}"; + + src = fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-syntax-highlighting"; + rev = version; + sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4"; + }; + + buildInputs = [ zsh ]; + + installFlags = "PREFIX=$(out)"; + + meta = with stdenv.lib; { + description = "Fish shell like syntax highlighting for Zsh"; + homepage = https://github.com/zsh-users/zsh-syntax-highlighting; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = [ maintainers.loskutov ]; + }; +} |