From c26c951386e422814c411693184018b7df4430d6 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 12 Jan 2017 07:40:33 +0100 Subject: machines/meshuggah: Set cyan color in prompt This is mainly to distinguish the prompt color from my workstations so it's clearly obvious that I'm working on meshuggah rather than say mmrnmhrm. We needed to add another option to the zsh module so that we can easily override machine colors for other machines as well. Signed-off-by: aszlig --- modules/user/aszlig/programs/zsh/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/user/aszlig/programs/zsh/default.nix b/modules/user/aszlig/programs/zsh/default.nix index 119b6aa9..71b1ca09 100644 --- a/modules/user/aszlig/programs/zsh/default.nix +++ b/modules/user/aszlig/programs/zsh/default.nix @@ -4,10 +4,22 @@ with lib; let cfg = config.vuizvui.user.aszlig.programs.zsh; + inherit (cfg) machineColor; in { options.vuizvui.user.aszlig.programs.zsh = { enable = mkEnableOption "zsh"; + + machineColor = mkOption { + type = types.enum [ + "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" + ]; + default = "red"; + example = "green"; + description = '' + The color used for coloring the machine name in the prompt. + ''; + }; }; config = mkIf cfg.enable { @@ -107,7 +119,7 @@ in { autoload -Uz prompt_special_chars () { - local p_machine='%(!..%B%F{red}%n%b%F{blue}@)%b%F{red}%m' + local p_machine='%(!..%B%F{red}%n%b%F{blue}@)%b%F{${machineColor}}%m' local p_path='%B%F{blue}[%F{cyan}%~%B%F{blue}]' local p_exitcode='%F{green}%?%(!.%F{cyan}>.%b%F{green}>)%b%f ' PROMPT="$p_machine$p_path$p_exitcode" -- cgit 1.4.1