summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorIgnat Loskutov <loskutov@google.com>2016-10-03 01:07:23 +0300
committerJörg Thalheim <joerg@higgsboson.tk>2016-10-03 17:49:04 +0200
commit9f34b5595e28e64f80f6615eb99cbd5b98b97529 (patch)
treefefd5f3002b1da514daaa31979f84e129c9fa02f /nixos/modules
parent5e882ea558c15140e1ae0c1e296d2e1e914f96e7 (diff)
downloadnixlib-9f34b5595e28e64f80f6615eb99cbd5b98b97529.tar
nixlib-9f34b5595e28e64f80f6615eb99cbd5b98b97529.tar.gz
nixlib-9f34b5595e28e64f80f6615eb99cbd5b98b97529.tar.bz2
nixlib-9f34b5595e28e64f80f6615eb99cbd5b98b97529.tar.lz
nixlib-9f34b5595e28e64f80f6615eb99cbd5b98b97529.tar.xz
nixlib-9f34b5595e28e64f80f6615eb99cbd5b98b97529.tar.zst
nixlib-9f34b5595e28e64f80f6615eb99cbd5b98b97529.zip
zsh-syntax-highlighting: init at 0.4.1
fixes #19179
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/programs/zsh/zsh.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix
index d81f63c2acca..5b7d94157454 100644
--- a/nixos/modules/programs/zsh/zsh.nix
+++ b/nixos/modules/programs/zsh/zsh.nix
@@ -84,6 +84,14 @@ in
         type = types.bool;
       };
 
+      enableSyntaxHighlighting = mkOption {
+        default = false;
+        description = ''
+          Enable zsh-syntax-highlighting
+        '';
+        type = types.bool;
+      };
+
     };
 
   };
@@ -120,6 +128,10 @@ in
 
         ${if cfg.enableCompletion then "autoload -U compinit && compinit" else ""}
 
+        ${optionalString (cfg.enableSyntaxHighlighting)
+          "source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
+        }
+
         HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
       '';
 
@@ -182,7 +194,8 @@ in
     environment.etc."zinputrc".source = ./zinputrc;
 
     environment.systemPackages = [ pkgs.zsh ]
-      ++ optional cfg.enableCompletion pkgs.nix-zsh-completions;
+      ++ optional cfg.enableCompletion pkgs.nix-zsh-completions
+      ++ optional cfg.enableSyntaxHighlighting pkgs.zsh-syntax-highlighting;
 
     environment.pathsToLink = optional cfg.enableCompletion "/share/zsh";