diff --git a/pkgs/shells/zsh/zsh-powerlevel10k/default.nix b/pkgs/shells/zsh/zsh-powerlevel10k/default.nix new file mode 100644 index 000000000000..d5081476efb5 --- /dev/null +++ b/pkgs/shells/zsh/zsh-powerlevel10k/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchFromGitHub, substituteAll, pkgs }: + +# To make use of this derivation, use +# `programs.zsh.promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";` + +stdenv.mkDerivation { + pname = "powerlevel10k"; + version = "unstable-2019-12-19"; + src = fetchFromGitHub { + owner = "romkatv"; + repo = "powerlevel10k"; + rev = "8ef2b737d1f6099966a1eb16bdfc90d67b367f22"; + sha256 = "02b25klkyyhpdbf2vwzzbrd8hnfjpckbpjy6532ir6jqp2n2ivpj"; + }; + + patches = [ + (substituteAll { + src = ./gitstatusd.patch; + gitstatusdPath = "${pkgs.gitAndTools.gitstatus}/bin/gitstatusd"; + }) + ]; + + installPhase = '' + install -D powerlevel10k.zsh-theme --target-directory=$out/share/zsh-powerlevel10k + install -D config/* --target-directory=$out/share/zsh-powerlevel10k/config + install -D internal/* --target-directory=$out/share/zsh-powerlevel10k/internal + rm -r gitstatus/bin + install -D gitstatus/* --target-directory=$out/share/zsh-powerlevel10k/gitstatus + ''; + + meta = { + description = "A fast reimplementation of Powerlevel9k ZSH theme"; + homepage = "https://github.com/romkatv/powerlevel10k"; + license = stdenv.lib.licenses.mit; + + platforms = stdenv.lib.platforms.unix; + maintainers = [ stdenv.lib.maintainers.hexa ]; + }; +} diff --git a/pkgs/shells/zsh/zsh-powerlevel10k/gitstatusd.patch b/pkgs/shells/zsh/zsh-powerlevel10k/gitstatusd.patch new file mode 100644 index 000000000000..a4440079e4bb --- /dev/null +++ b/pkgs/shells/zsh/zsh-powerlevel10k/gitstatusd.patch @@ -0,0 +1,14 @@ +diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh +index 46d0b3c..b082e24 100644 +--- a/gitstatus/gitstatus.plugin.zsh ++++ b/gitstatus/gitstatus.plugin.zsh +@@ -53,6 +53,8 @@ + + [[ -o 'interactive' ]] || 'return' + ++GITSTATUS_DAEMON=@gitstatusdPath@ ++ + # Temporarily change options. + 'builtin' 'local' '-a' '_gitstatus_opts' + [[ ! -o 'aliases' ]] || _gitstatus_opts+=('aliases') + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f54db64d9134..f6774c4b8450 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7543,6 +7543,8 @@ in zsh-autosuggestions = callPackage ../shells/zsh/zsh-autosuggestions { }; + zsh-powerlevel10k = callPackage ../shells/zsh/zsh-powerlevel10k { }; + zsh-powerlevel9k = callPackage ../shells/zsh/zsh-powerlevel9k { }; zsh-command-time = callPackage ../shells/zsh/zsh-command-time { };