Initial commit

This commit is contained in:
marc
2022-10-02 20:33:40 +02:00
commit a1d321316c
30 changed files with 2492 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.samfelag.modules.shell.zsh;
in
{
options.samfelag.modules.shell.zsh = {
enable = mkEnableOption "zsh configuration";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
zsh
zsh-powerlevel10k
(nerdfonts.override { fonts = [ "Iosevka" ]; })
];
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
enableAutosuggestions = true;
enableCompletion = true;
enableSyntaxHighlighting = true;
initExtra = ''
# Source generic (bash) configuration
if [ -d $HOME/.config/shell/sh ]; then
for rc in $HOME/.config/shell/sh/*.sh; do
emulate bash -c ". $rc"
done
fi
# Source zsh specific configuration
if [[ -d $HOME/.config/shell/zsh ]]; then
for rc in $HOME/.config/shell/zsh/*.zsh; do
source $rc
done
fi
'';
initExtraBeforeCompInit = ''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
'';
oh-my-zsh = {
enable = true;
plugins = [
"git"
# "zsh-vi-mode"
];
};
plugins = [
{
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
];
};
xdg.configFile."zsh/.p10k.zsh".source = ../../../config/.config/zsh/.p10k.zsh;
};
}