Unable to get `zsh.syntaxHighlighting` module to work

I am trying to configure my home-manager ( 23.05 ) version.

I tried to use the default zsh.syntaxHighlighting module referenced here:

Here’s my implementation:

    programs.zsh = {

        enable = true;
        ...
        ...
        syntaxHighlighting = {
            enable = true;
            styles = {
                alias = "fg=magenta";
                unknown-token = "fg=red";
                precommand = "fg=#23f93d";
                command = "fg=#24eef9,bold";
                path = "fg=#24eef9";
                globbing = "fg=#24eef9";
            };
        };

but I get this error:

$ home-manager switch
error: The option `programs.zsh.syntaxHighlighting' does not exist. Definition values:
       - In `/home/notpua/storage/nixos/home-manager/zsh.nix':
           {
             enable = true;
             styles = {
               alias = "fg=magenta";
               command = "fg=#24eef9,bold";
           ...
(use '--show-trace' to show detailed location information)

Here’s the trace

Note: Im using 23.05 latest recommended stable version, here’s my nix-info output.

1 Like

I’m also getting the same error. I don’t understand why this happens if the option is supposed to exist in 23.05 according to NixOS Search (also, home-manager option Appendix A. Configuration Options )

EDIT: well, if I switch back to use enableSyntaxHighlighting things work fine. So if you are using 23.05, then use enableSyntaxHighlighting instead of syntaxHighlighting.enable

But how do i change the styles, it says the option syntaxHighlighting itself doesn’t exist