my nixos config looks like this:
{ config, pkgs, ... }: {
programs.zsh = {
enable = true;
ohMyZsh = {
enable = true;
plugins = [ "git" "zsh-history-substring-search" ];
};
};
users.users.USER.shell = pkgs.zsh;
environment.systemPackages = [
pkgs.oh-my-zsh
pkgs.zsh
pkgs.zsh-completions
pkgs.zsh-powerlevel10k
pkgs.zsh-syntax-highlighting
pkgs.zsh-history-substring-search
];
}
and i kind of expected that my existing .zshrc just works, but this is not the case. For example when opening a new shell i get this error:
[oh-my-zsh] plugin 'zsh-history-substring-search' not found
But its clearly installed (see systemPackages).
Also i had this in my .zshrc file:
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
which makes sense that it cannot be sourced (since its probably installed somewhere else), but my question now is: where is stuff actually installed in nixos? How can i find this file?
The configuration looks correct. Here are some debugging ideas,
zshrcshould have a linesource $ZSH/oh-my-zsh.shgenerated. Runcd $ZSHto enter that directory.oh-my-zsh.shfile. There should be a block similar to the one below (I use home-manager, so yours might look different)Here you can find the plugins directory. In my case it was
pluginsfolder in the same directory.fyi,
programs.zsh.syntaxHighlighting.enableto trueprograms.zsh.ohMyZsh.themeinstead of sourcing the theme file manually.