Grml-zsh-config auto-completion issue in NixOS

Hello, I want to install and use grml-zsh-config in NixOS. I installed it by adding

  programs.zsh = {
    enable = true;
    interactiveShellInit = "source ${pkgs.grml-zsh-config}/etc/zsh/zshrc";
    promptInit = "";

to the /etc/nixos/configuration.nix and now I can run it. But when I try to autocomplete the sudo command, it doesn’t work.

For example typing sudo <TAB> gives me only:

completing external command
env  sh

Strangely, the sudo git <TAB> work fine.

Any ideas how can I solve this problem?

the grml zshrc tries to be smart and sets the search path for sudo to include the “root only programs” (sbin directories).

I had to clear this setting in programs.zsh.interactiveShellInit to get sudo completion working:

zstyle -d ':completion:*:sudo:*' command-path
1 Like