2021-01-15 06:28:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, substituteAll, pkgs }:
|
2019-12-23 22:27:53 +00:00
|
|
|
|
|
|
|
# To make use of this derivation, use
|
|
|
|
# `programs.zsh.promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";`
|
|
|
|
|
2020-10-28 16:14:12 +00:00
|
|
|
let
|
|
|
|
# match gitstatus version with given `gitstatus_version`:
|
|
|
|
# https://github.com/romkatv/powerlevel10k/blob/master/gitstatus/build.info
|
gitAndTools: move everything to the top level
The comment at the top of git-and-tools/default.nix said:
/* All git-relates tools live here, in a separate attribute set so that users
* can get a fast overview over what's available.
but unfortunately that hasn't actually held up in practice.
Git-related packages have continued to be added to the top level, or
into gitAndTools, or sometimes both, basically at random, so having
gitAndTools is just confusing. In fact, until I looked as part of
working on getting rid of gitAndTools, one program (ydiff) was
packaged twice independently, once in gitAndTools and once at the top
level (I fixed this in 98c34901969).
So I think it's for the best if we move away from gitAndTools, and
just put all the packages it previously contained at the top level.
I've implemented this here by just making gitAndTools an alias for the
top level -- this saves having loads of lines in aliases.nix. This
means that people can keep referring to gitAndTools in their
configuration, but it won't be allowed to be used within Nixpkgs, and
it won't be presented to new users by e.g. nix search.
The only other change here that I'm aware of is that
appendToName "minimal" is not longer called on the default git
package, because doing that would have necessitated having a private
gitBase variable like before. I think it makes more sense not to do
that anyway, and reserve the "minimal" suffix only for gitMinimal.
2021-01-14 17:49:32 +00:00
|
|
|
gitstatus = pkgs.gitstatus.overrideAttrs (oldAtttrs: rec {
|
2020-11-26 10:52:20 +00:00
|
|
|
version = "1.3.1";
|
2020-10-28 16:14:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "romkatv";
|
|
|
|
repo = "gitstatus";
|
|
|
|
rev = "v${version}";
|
2020-11-26 10:52:20 +00:00
|
|
|
sha256 = "03zaywncds7pjrl07rvdf3fh39gnp2zfvgsf0afqwv317sgmgpzf";
|
2020-10-28 16:14:12 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
zsh-powerlevel10k: 1.1 → 1.2.0
Changes since the last release
New segments:
wifi: shows WiFi data transfer speed; can optionally display security level, SSID, etc.
asdf: tool versions from asdf.
taskwarrior: task counts from taskwarrior.
phpenv: PHP version from phpenv.
New parameters:
POWERLEVEL9K_${SEGMENT}_${STATE}_SHOW_ON_UPGLOB with regular fallback; this allows you to display a prompt segment only whethere is a file matching a certain pattern in the current directory, or in .., or in ../.., etc. For example: POWERLEVEL9K_NODE_VERSION_SHOW_ON_UPGLOB='package.json|node_modules' to show node_version segment only in Node project directories.
POWERLEVEL9K_VPN_IP_SHOW_ALL: if set to true, vpn_ip will show IPs from all matching network interfaces instead of just the first.
POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER: when set to true, drops path before the last marked directory (usually a Git repo root).
More fine grained control over battery colors: POWERLEVEL9K_BATTERY_${state}_{STAGES,LEVEL_BACKGROUND,LEVEL_FOREGROUND}.
Network transfer speed: P9K_IP_TX_RATE and P9K_IP_RX_RATE in ip segment.
Configuration wizard:
Gracefully handle non-writable ~/.zshrc.
New segments enabled by default: asdf, taskwarrior, phpenv.
New segments disabled by default: php_version, laravel_version.
Git status now displays VCS_STATUS_PUSH_COMMITS_{AHEAD,BEHIND}.
Git status now displays "─" when POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY is in effect.
Git status by default ignores the git repo rooted at $HOME; see POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN.
Pure style now has context on the very left; upstream: sindresorhus/pure#530.
When installing the recommended font for iTerm2, detect and attempt to delete (after confirmation from the user) other versions of MesloLGS NF.
New style: robbyrussell; not exposed through the wizard; enable it with source .../powerlevel10k/config/p10k-robbyrussell.zsh.
Prompt performance improvements:
Async worker chatter is now 2x faster.
Prompt rendering and gitstatus_query now run in parallel; this reduces prompt latency by up to 5ms.
Bug fixes:
truncate_to_last now behaves exactly like %1~.
Don't crap out when file names contain colon.
Don't crap out when using more than one prompt_char.
Don't crap out when PATH is empty.
gcloud now works when using non-default configs.
timewarrior segment now respects $TIMEWARRIORDB (thanks, @errantepiphany!).
Pick up ip and ifconfig tools from PATH (used to be /sbin/ip and /sbin/ifconfig).
SHOW_ON_COMMAND now works with legacy custom prompt segments.
Git status in Pure style now has correct number of spaces.
Robustness improvements:
Work around a bug in sysread in Zsh (fixed in Zsh 5.8).
Replace all wide icons with narrow by default (many terminals choke on wide icons).
Replace terraform icons with another (emacs crashes on the old icon).
Prompt should now function even when locale is misconfigured as long as there is at least one UTF-8 locale installed on the system.
Workarounds for Zsh bugs in handling of ZLE_RPROMPT_INDENT=0 are now applied in more cases.
gitstatus:
Support repositories where .git is a symbolic link.
Support repositories with preciousObjects extension.
Add VCS_STATUS_PUSH_{REMOTE_NAME,REMOTE_URL,COMMITS_AHEAD,COMMITS_BEHIND}: similar to VCS_STATUS_{REMOTE_NAME,REMOTE_URL,COMMITS_AHEAD,COMMITS_BEHIND} but for @push remote.
Add VCS_STATUS_NUM_SKIP_WORKTREE and VCS_STATUS_NUM_ASSUME_UNCHANGED: the number of files in the index with --skip-worktree and --assume-unchanged bits respectively`.
Support Cygwin on older versions of Windows
Completely rewritten Zsh API (similar to async worker in powerlevel10k); this makes startup about 5x faster and should be more robust.
The gitstatusd binary is now looked up as follows:
If GITSTATUS_DAEMON is an absolute path, use that.
Else if GITSTATUS_DAEMON is a valid command name (PATH lookup), use that.
Else if GITSTATUS_DAEMON is not empty, try $gitstatus_dir/{usrbin,bin}/$GITSTATUS_DAEMON (in this order).
Else try $gitstatus_dir/{usrbin,bin}/gitstatusd-$os-$arch{,-static} (in this order).
2020-02-26 19:55:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-12-23 22:27:53 +00:00
|
|
|
pname = "powerlevel10k";
|
2020-12-18 17:13:01 +00:00
|
|
|
version = "1.14.4";
|
zsh-powerlevel10k: 1.1 → 1.2.0
Changes since the last release
New segments:
wifi: shows WiFi data transfer speed; can optionally display security level, SSID, etc.
asdf: tool versions from asdf.
taskwarrior: task counts from taskwarrior.
phpenv: PHP version from phpenv.
New parameters:
POWERLEVEL9K_${SEGMENT}_${STATE}_SHOW_ON_UPGLOB with regular fallback; this allows you to display a prompt segment only whethere is a file matching a certain pattern in the current directory, or in .., or in ../.., etc. For example: POWERLEVEL9K_NODE_VERSION_SHOW_ON_UPGLOB='package.json|node_modules' to show node_version segment only in Node project directories.
POWERLEVEL9K_VPN_IP_SHOW_ALL: if set to true, vpn_ip will show IPs from all matching network interfaces instead of just the first.
POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER: when set to true, drops path before the last marked directory (usually a Git repo root).
More fine grained control over battery colors: POWERLEVEL9K_BATTERY_${state}_{STAGES,LEVEL_BACKGROUND,LEVEL_FOREGROUND}.
Network transfer speed: P9K_IP_TX_RATE and P9K_IP_RX_RATE in ip segment.
Configuration wizard:
Gracefully handle non-writable ~/.zshrc.
New segments enabled by default: asdf, taskwarrior, phpenv.
New segments disabled by default: php_version, laravel_version.
Git status now displays VCS_STATUS_PUSH_COMMITS_{AHEAD,BEHIND}.
Git status now displays "─" when POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY is in effect.
Git status by default ignores the git repo rooted at $HOME; see POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN.
Pure style now has context on the very left; upstream: sindresorhus/pure#530.
When installing the recommended font for iTerm2, detect and attempt to delete (after confirmation from the user) other versions of MesloLGS NF.
New style: robbyrussell; not exposed through the wizard; enable it with source .../powerlevel10k/config/p10k-robbyrussell.zsh.
Prompt performance improvements:
Async worker chatter is now 2x faster.
Prompt rendering and gitstatus_query now run in parallel; this reduces prompt latency by up to 5ms.
Bug fixes:
truncate_to_last now behaves exactly like %1~.
Don't crap out when file names contain colon.
Don't crap out when using more than one prompt_char.
Don't crap out when PATH is empty.
gcloud now works when using non-default configs.
timewarrior segment now respects $TIMEWARRIORDB (thanks, @errantepiphany!).
Pick up ip and ifconfig tools from PATH (used to be /sbin/ip and /sbin/ifconfig).
SHOW_ON_COMMAND now works with legacy custom prompt segments.
Git status in Pure style now has correct number of spaces.
Robustness improvements:
Work around a bug in sysread in Zsh (fixed in Zsh 5.8).
Replace all wide icons with narrow by default (many terminals choke on wide icons).
Replace terraform icons with another (emacs crashes on the old icon).
Prompt should now function even when locale is misconfigured as long as there is at least one UTF-8 locale installed on the system.
Workarounds for Zsh bugs in handling of ZLE_RPROMPT_INDENT=0 are now applied in more cases.
gitstatus:
Support repositories where .git is a symbolic link.
Support repositories with preciousObjects extension.
Add VCS_STATUS_PUSH_{REMOTE_NAME,REMOTE_URL,COMMITS_AHEAD,COMMITS_BEHIND}: similar to VCS_STATUS_{REMOTE_NAME,REMOTE_URL,COMMITS_AHEAD,COMMITS_BEHIND} but for @push remote.
Add VCS_STATUS_NUM_SKIP_WORKTREE and VCS_STATUS_NUM_ASSUME_UNCHANGED: the number of files in the index with --skip-worktree and --assume-unchanged bits respectively`.
Support Cygwin on older versions of Windows
Completely rewritten Zsh API (similar to async worker in powerlevel10k); this makes startup about 5x faster and should be more robust.
The gitstatusd binary is now looked up as follows:
If GITSTATUS_DAEMON is an absolute path, use that.
Else if GITSTATUS_DAEMON is a valid command name (PATH lookup), use that.
Else if GITSTATUS_DAEMON is not empty, try $gitstatus_dir/{usrbin,bin}/$GITSTATUS_DAEMON (in this order).
Else try $gitstatus_dir/{usrbin,bin}/gitstatusd-$os-$arch{,-static} (in this order).
2020-02-26 19:55:55 +00:00
|
|
|
|
2019-12-23 22:27:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "romkatv";
|
|
|
|
repo = "powerlevel10k";
|
zsh-powerlevel10k: 1.1 → 1.2.0
Changes since the last release
New segments:
wifi: shows WiFi data transfer speed; can optionally display security level, SSID, etc.
asdf: tool versions from asdf.
taskwarrior: task counts from taskwarrior.
phpenv: PHP version from phpenv.
New parameters:
POWERLEVEL9K_${SEGMENT}_${STATE}_SHOW_ON_UPGLOB with regular fallback; this allows you to display a prompt segment only whethere is a file matching a certain pattern in the current directory, or in .., or in ../.., etc. For example: POWERLEVEL9K_NODE_VERSION_SHOW_ON_UPGLOB='package.json|node_modules' to show node_version segment only in Node project directories.
POWERLEVEL9K_VPN_IP_SHOW_ALL: if set to true, vpn_ip will show IPs from all matching network interfaces instead of just the first.
POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER: when set to true, drops path before the last marked directory (usually a Git repo root).
More fine grained control over battery colors: POWERLEVEL9K_BATTERY_${state}_{STAGES,LEVEL_BACKGROUND,LEVEL_FOREGROUND}.
Network transfer speed: P9K_IP_TX_RATE and P9K_IP_RX_RATE in ip segment.
Configuration wizard:
Gracefully handle non-writable ~/.zshrc.
New segments enabled by default: asdf, taskwarrior, phpenv.
New segments disabled by default: php_version, laravel_version.
Git status now displays VCS_STATUS_PUSH_COMMITS_{AHEAD,BEHIND}.
Git status now displays "─" when POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY is in effect.
Git status by default ignores the git repo rooted at $HOME; see POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN.
Pure style now has context on the very left; upstream: sindresorhus/pure#530.
When installing the recommended font for iTerm2, detect and attempt to delete (after confirmation from the user) other versions of MesloLGS NF.
New style: robbyrussell; not exposed through the wizard; enable it with source .../powerlevel10k/config/p10k-robbyrussell.zsh.
Prompt performance improvements:
Async worker chatter is now 2x faster.
Prompt rendering and gitstatus_query now run in parallel; this reduces prompt latency by up to 5ms.
Bug fixes:
truncate_to_last now behaves exactly like %1~.
Don't crap out when file names contain colon.
Don't crap out when using more than one prompt_char.
Don't crap out when PATH is empty.
gcloud now works when using non-default configs.
timewarrior segment now respects $TIMEWARRIORDB (thanks, @errantepiphany!).
Pick up ip and ifconfig tools from PATH (used to be /sbin/ip and /sbin/ifconfig).
SHOW_ON_COMMAND now works with legacy custom prompt segments.
Git status in Pure style now has correct number of spaces.
Robustness improvements:
Work around a bug in sysread in Zsh (fixed in Zsh 5.8).
Replace all wide icons with narrow by default (many terminals choke on wide icons).
Replace terraform icons with another (emacs crashes on the old icon).
Prompt should now function even when locale is misconfigured as long as there is at least one UTF-8 locale installed on the system.
Workarounds for Zsh bugs in handling of ZLE_RPROMPT_INDENT=0 are now applied in more cases.
gitstatus:
Support repositories where .git is a symbolic link.
Support repositories with preciousObjects extension.
Add VCS_STATUS_PUSH_{REMOTE_NAME,REMOTE_URL,COMMITS_AHEAD,COMMITS_BEHIND}: similar to VCS_STATUS_{REMOTE_NAME,REMOTE_URL,COMMITS_AHEAD,COMMITS_BEHIND} but for @push remote.
Add VCS_STATUS_NUM_SKIP_WORKTREE and VCS_STATUS_NUM_ASSUME_UNCHANGED: the number of files in the index with --skip-worktree and --assume-unchanged bits respectively`.
Support Cygwin on older versions of Windows
Completely rewritten Zsh API (similar to async worker in powerlevel10k); this makes startup about 5x faster and should be more robust.
The gitstatusd binary is now looked up as follows:
If GITSTATUS_DAEMON is an absolute path, use that.
Else if GITSTATUS_DAEMON is a valid command name (PATH lookup), use that.
Else if GITSTATUS_DAEMON is not empty, try $gitstatus_dir/{usrbin,bin}/$GITSTATUS_DAEMON (in this order).
Else try $gitstatus_dir/{usrbin,bin}/gitstatusd-$os-$arch{,-static} (in this order).
2020-02-26 19:55:55 +00:00
|
|
|
rev = "v${version}";
|
2020-12-18 17:13:01 +00:00
|
|
|
sha256 = "1072ikklvpvx6qf0q8ydbi1qc1dxjjfs4031b4zzgjw766xnpcbk";
|
2019-12-23 22:27:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./gitstatusd.patch;
|
2020-10-28 16:14:12 +00:00
|
|
|
gitstatusdPath = "${gitstatus}/bin/gitstatusd";
|
2019-12-23 22:27:53 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
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
|
2020-06-01 00:42:14 +01:00
|
|
|
cp -R gitstatus $out/share/zsh-powerlevel10k/gitstatus
|
2019-12-23 22:27:53 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A fast reimplementation of Powerlevel9k ZSH theme";
|
|
|
|
homepage = "https://github.com/romkatv/powerlevel10k";
|
2021-01-15 06:28:56 +00:00
|
|
|
license = lib.licenses.mit;
|
2019-12-23 22:27:53 +00:00
|
|
|
|
2021-01-15 06:28:56 +00:00
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = [ lib.maintainers.hexa ];
|
2019-12-23 22:27:53 +00:00
|
|
|
};
|
|
|
|
}
|