In the nixOS config I hav it like so:
programs.zsh = {
shellInit = ''
autoload -U promptinit; promptinit
'';
interactiveShellInit = ''
source ${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
source ${pkgs.zsh-you-should-use}/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh
'';
}
in home manager config I can use the plugins keyword:
programs.zsh = {
plugins = [
{
name = "nix-shell";
src = "${pkgs.zsh-nix-shell}/share/zsh-nix-shell";
}
{
name = "you-should-use";
src = "${pkgs.zsh-you-should-use}/share/zsh/plugins/you-should-use";
}
{
name = "zsh-vi-mode";
src = "${pkgs.zsh-vi-mode}/share/zsh-vi-mode";
}
{
name = "zsh-z";
src = "${pkgs.zsh-z}/share/zsh-z";
}
];
}
I figured the paths by poking the store with something like find /nix/store -iwholename "*you-should-use*"