From baa3b3effff51d9aea43ee524329f8bbcbdaf3ec Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 25 Apr 2017 16:00:20 +0200 Subject: [PATCH] programs.zsh.syntax-highlighting: refactor `highlighters` option for proper validation Right now the `programs.zsh.syntax-highlighting.highlighters` option lacks appropriate validation which can cause confusing things when mistyping a higlighter for zsh-syntax-highlighting. --- .../modules/programs/zsh/zsh-syntax-highlighting.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/modules/programs/zsh/zsh-syntax-highlighting.nix b/nixos/modules/programs/zsh/zsh-syntax-highlighting.nix index 962c1f920a86..fde241ca3ce3 100644 --- a/nixos/modules/programs/zsh/zsh-syntax-highlighting.nix +++ b/nixos/modules/programs/zsh/zsh-syntax-highlighting.nix @@ -18,7 +18,17 @@ in highlighters = mkOption { default = [ "main" ]; - type = types.listOf(types.str); + + # https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md + type = types.listOf(types.enum([ + "main" + "brackets" + "pattern" + "cursor" + "root" + "line" + ])); + description = '' Specifies the highlighters to be used by zsh-syntax-highlighting.