Zsh compinit warning on every shell session

I believe that command is automatically added to the .zshrc file by home manager.
I have tried adding the following config option to my home.nix file but to no avail.

programs.zsh.completionInit = "autoload -U compinit && compinit -u";

This changes the command inside .zshrc but the error message still occurs. Changing it to autoload -U 'compinit -u' && compinit -u causes the following error message to appear:

zsh compinit: insecure directories and files, run compaudit for list.
Ignore insecure directories and files and continue [y] or abort compinit [n]? ncompinit: initialization aborted
compinit: command not found