git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #96532 from flokli/ohmyzsh-cleanups

oh-my-zsh: cleanups, don't require perl in pygmalion theme anymore

commitf076cd769d20649b653e2f271896e39df092fe21 authorTim Steinbach <NeQuissimus@users.noreply.github.com> dateMon 31 Aug 2020, 09:10 (6 years ago) parent873a776c23a404
1 file changed+41−44
pkgs/shells/zsh/oh-my-zsh/default.nix+41−44
pkgs/shells/zsh/oh-my-zsh/default.nix+41−44
@@ -1,70 +1,67 @@
11# This script was inspired by the ArchLinux User Repository package:
22#
33# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=oh-my-zsh-git
4−{ stdenv, fetchgit }:
4+{ stdenv, fetchFromGitHub }:
55
66stdenv.mkDerivation rec {
77 version = "2020-08-28";
88 pname = "oh-my-zsh";
9− rev = "4ed6fd2b8b6a0efb2f84f00a64503282aca260e7";
109
11− src = fetchgit { inherit rev;
12− url = "https://github.com/ohmyzsh/ohmyzsh";
10+ src = fetchFromGitHub {
11+ owner = "ohmyzsh";
12+ repo = "ohmyzsh";
13+ rev = "4ed6fd2b8b6a0efb2f84f00a64503282aca260e7";
1314 sha256 = "0f2f1k6s28lgxpjdgl4s7jisw6dgva9mcsqlsq0wg6041p246nai";
1415 };
1516
16− pathsToLink = [ "/share/oh-my-zsh" ];
17−
18− phases = "installPhase";
19−
2017 installPhase = ''
21− outdir=$out/share/oh-my-zsh
22− template=templates/zshrc.zsh-template
18+ outdir=$out/share/oh-my-zsh
19+ template=templates/zshrc.zsh-template
2320
24− mkdir -p $outdir
25− cp -r $src/* $outdir
26− cd $outdir
21+ mkdir -p $outdir
22+ cp -r * $outdir
23+ cd $outdir
2724
28− rm LICENSE.txt
29− rm -rf .git*
25+ rm LICENSE.txt
26+ rm -rf .git*
3027
31− chmod -R +w templates
28+ chmod -R +w templates
3229
33− # Change the path to oh-my-zsh dir and disable auto-updating.
34− sed -i -e "s#ZSH=\$HOME/.oh-my-zsh#ZSH=$outdir#" \
35− -e 's/\# \(DISABLE_AUTO_UPDATE="true"\)/\1/' \
36− $template
30+ # Change the path to oh-my-zsh dir and disable auto-updating.
31+ sed -i -e "s#ZSH=\$HOME/.oh-my-zsh#ZSH=$outdir#" \
32+ -e 's/\# \(DISABLE_AUTO_UPDATE="true"\)/\1/' \
33+ $template
3734
38− chmod +w oh-my-zsh.sh
35+ chmod +w oh-my-zsh.sh
3936
40− # Both functions expect oh-my-zsh to be in ~/.oh-my-zsh and try to
41− # modify the directory.
42− cat >> oh-my-zsh.sh <<- EOF
37+ # Both functions expect oh-my-zsh to be in ~/.oh-my-zsh and try to
38+ # modify the directory.
39+ cat >> oh-my-zsh.sh <<- EOF
4340
44− # Undefine functions that don't work on Nix.
45− unfunction uninstall_oh_my_zsh
46− unfunction upgrade_oh_my_zsh
47− EOF
41+ # Undefine functions that don't work on Nix.
42+ unfunction uninstall_oh_my_zsh
43+ unfunction upgrade_oh_my_zsh
44+ EOF
4845
49− # Look for .zsh_variables, .zsh_aliases, and .zsh_funcs, and source
50− # them, if found.
51− cat >> $template <<- EOF
46+ # Look for .zsh_variables, .zsh_aliases, and .zsh_funcs, and source
47+ # them, if found.
48+ cat >> $template <<- EOF
5249
53− # Load the variables.
54− if [ -f ~/.zsh_variables ]; then
55− . ~/.zsh_variables
56− fi
50+ # Load the variables.
51+ if [ -f ~/.zsh_variables ]; then
52+ . ~/.zsh_variables
53+ fi
5754
58− # Load the functions.
59− if [ -f ~/.zsh_funcs ]; then
60− . ~/.zsh_funcs
61− fi
55+ # Load the functions.
56+ if [ -f ~/.zsh_funcs ]; then
57+ . ~/.zsh_funcs
58+ fi
6259
63− # Load the aliases.
64− if [ -f ~/.zsh_aliases ]; then
65− . ~/.zsh_aliases
66− fi
67− EOF
60+ # Load the aliases.
61+ if [ -f ~/.zsh_aliases ]; then
62+ . ~/.zsh_aliases
63+ fi
64+ EOF
6865 '';
6966
7067 meta = with stdenv.lib; {