Working on reshuffling
This commit is contained in:
@@ -4,15 +4,20 @@ let
|
||||
username = "henrov";
|
||||
in
|
||||
{
|
||||
# Define a toggle option for enabling Zsh
|
||||
options.mySystem.terminals.zsh.enable =
|
||||
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
|
||||
|
||||
# Use `config` only inside a `config = { ... }` block of the module
|
||||
config = lib.mkIf (lib.getOption config.mySystem.terminals.zsh.enable) {
|
||||
# Module config block
|
||||
config = lib.mkIf (config.mySystem.terminals.zsh.enable or false) {
|
||||
|
||||
# Home Manager scope for the user
|
||||
home-manager.users.${username} = {
|
||||
|
||||
programs.zsh.enable = true;
|
||||
programs.zsh.enableCompletion = true;
|
||||
|
||||
# Oh-My-Zsh configuration
|
||||
programs.zsh.ohMyZsh = {
|
||||
enable = true;
|
||||
theme = "catppuccin-mocha";
|
||||
@@ -23,10 +28,11 @@ in
|
||||
"zsh-autosuggestions"
|
||||
"zsh-completions"
|
||||
"zsh-history-substring-search"
|
||||
"zsh-syntax-highlighting"
|
||||
# zsh-syntax-highlighting will be sourced in initExtra
|
||||
];
|
||||
};
|
||||
|
||||
# Extra init content
|
||||
programs.zsh.initExtra = ''
|
||||
# Catppuccin Mocha colors
|
||||
local mocha_base="#1E1E2E"
|
||||
@@ -46,8 +52,14 @@ in
|
||||
local mocha_flamingo="#F2CDCD"
|
||||
local mocha_rosewater="#F5E0DC"
|
||||
|
||||
# Prompt
|
||||
PROMPT='%{$fg[$mocha_blue]%}%n%{$reset_color%}@%{$fg[$mocha_peach]%}%m%{$reset_color%} %{$fg[$mocha_lavender]%}%~%{$reset_color%} %{$fg[$mocha_red]%}$%{$reset_color%} '
|
||||
RPROMPT='%{$fg[$mocha_green]%}%T%{$reset_color%}'
|
||||
|
||||
# Source zsh-syntax-highlighting properly
|
||||
if [ -f ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
|
||||
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user