about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-01-12 07:40:33 +0100
committeraszlig <aszlig@redmoonstudios.org>2017-01-12 07:40:33 +0100
commitc26c951386e422814c411693184018b7df4430d6 (patch)
treee1fb2130be53986dffe5ed86f08e5806b77d9467 /modules
parentd1015532a6f021b19eae3037b9ed7a2e4719d68d (diff)
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/user/aszlig/programs/zsh/default.nix14
1 files changed, 13 insertions, 1 deletions
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"