Add powerlevel10k to zsh

This commit is contained in:
Joshua Yuen 2025-08-21 19:15:38 -04:00
parent d17c309686
commit 2710f8988c
Signed by: josh
GPG Key ID: 502720BC22ED411C
8 changed files with 1786 additions and 26 deletions

View File

@ -1,4 +1,5 @@
{
config,
pkgs,
...
}:
@ -10,6 +11,8 @@
montserrat
nerd-fonts.jetbrains-mono
noto-fonts-emoji
];
] ++ (if config.modules.zsh.enable
then [ nerd-fonts.meslo-lg ]
else []);
};
}

View File

@ -1,5 +1,4 @@
{
config,
host,
lib,
osConfig,

View File

@ -1,4 +1,5 @@
{
config,
lib,
osConfig,
pkgs,
@ -6,13 +7,18 @@
}:
with lib;
let
cfg = osConfig.modules.hyprland;
hyprlandCfg = osConfig.modules.hyprland;
zshCfg = osConfig.modules.zsh;
in
{
config = mkIf (cfg.terminal == "kitty") {
config = mkIf (hyprlandCfg.terminal == "kitty") {
programs.kitty = {
enable = true;
package = pkgs.kitty;
font = {
name = mkIf (zshCfg.enable) (mkForce "MesloLGS Nerd Font");
package = mkIf (zshCfg.enable) (mkForce pkgs.nerd-fonts.meslo-lg);
};
settings = {
scrollback_lines = 10000;
shell_integration = true;

View File

@ -1,4 +1,5 @@
{
config,
lib,
osConfig,
pkgs,
@ -8,14 +9,16 @@
with lib;
let
cfg = osConfig.modules.zsh;
xdgCfg = config.xdg;
in
{
imports = [
./zshrc-personal.nix
./p10k.nix
];
programs.zsh = {
enable = cfg.enable;
dotDir = "${xdgCfg.configHome}/zsh";
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
@ -27,7 +30,6 @@ in
];
};
historySubstringSearch.enable = true;
history = {
ignoreDups = false;
save = 100000;
@ -35,6 +37,9 @@ in
};
initContent = ''
# p10k
source "${xdgCfg.configHome}/zsh/p10k.zsh";
# vi keybindings for menu select
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
@ -55,5 +60,13 @@ in
gs = "git status";
ssha = "eval $(ssh-agent) && ssh-add";
};
plugins = [
{
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/";
file = "powerlevel10k.zsh-theme";
}
];
};
}

19
modules/home/zsh/p10k.nix Normal file
View File

@ -0,0 +1,19 @@
{
config,
lib,
osConfig,
pkgs,
...
}:
with lib;
let
cfg = osConfig.modules.zsh;
xdgCfg = config.xdg;
in
{
config = mkIf cfg.enable {
home.file."${xdgCfg.configHome}/zsh/p10k.zsh" = {
source = ./p10k.zsh;
};
};
}

1739
modules/home/zsh/p10k.zsh Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +0,0 @@
{
lib,
osConfig,
pkgs,
...
}:
with lib;
let
cfg = osConfig.modules.zsh;
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [ zsh ];
home.file."./.zshrc-personal".text = ''
export EDITOR=vim
'';
};
}

View File

@ -10,7 +10,7 @@ in
{
options.modules.zsh = {
enable = mkEnableOption {
description = "Install ZSH";
description = "Install Zsh";
default = true;
};
};