Files
nix-config/modules/programs/zsh/zsh.nix
T
2026-11-22 14:37:40 +01:00

56 lines
1.5 KiB
Nix

{ inputs, ... }: {
flake.modules.nixos.zsh = {
programs.zsh.enable = true;
environment.pathsToLink = [ "/share/zsh" ];
};
flake.modules.homeManager.zsh = { pkgs, ... }: {
imports = with inputs.self.modules.homeManager; [
fzf
zoxide
];
programs.zsh = {
enable = true;
autocd = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initContent = pkgs.lib.mkBefore ''
date
if [[ -e ~/todos.md ]]; then
${pkgs.glow}/bin/glow ~/todos.md
fi
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
'';
plugins = [
{
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/";
file = "powerlevel10k.zsh-theme";
}
{
name = "p10k-config";
src = ./p10k;
file = "p10k.zsh";
}
];
oh-my-zsh = {
enable = true;
plugins = [
];
theme = "robbyrussell";
};
};
};
}