Working on reshuffling
This commit is contained in:
+15
-3
@@ -1313,15 +1313,20 @@ let
|
|||||||
username = "henrov";
|
username = "henrov";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# Define a toggle option for enabling Zsh
|
||||||
options.mySystem.terminals.zsh.enable =
|
options.mySystem.terminals.zsh.enable =
|
||||||
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
|
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
|
||||||
|
|
||||||
# Use `config` only inside a `config = { ... }` block of the module
|
# Module config block
|
||||||
config = lib.mkIf (lib.getOption config.mySystem.terminals.zsh.enable) {
|
config = lib.mkIf (config.mySystem.terminals.zsh.enable or false) {
|
||||||
|
|
||||||
|
# Home Manager scope for the user
|
||||||
home-manager.users.${username} = {
|
home-manager.users.${username} = {
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
programs.zsh.enableCompletion = true;
|
programs.zsh.enableCompletion = true;
|
||||||
|
|
||||||
|
# Oh-My-Zsh configuration
|
||||||
programs.zsh.ohMyZsh = {
|
programs.zsh.ohMyZsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
theme = "catppuccin-mocha";
|
theme = "catppuccin-mocha";
|
||||||
@@ -1332,10 +1337,11 @@ in
|
|||||||
"zsh-autosuggestions"
|
"zsh-autosuggestions"
|
||||||
"zsh-completions"
|
"zsh-completions"
|
||||||
"zsh-history-substring-search"
|
"zsh-history-substring-search"
|
||||||
"zsh-syntax-highlighting"
|
# zsh-syntax-highlighting will be sourced in initExtra
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Extra init content
|
||||||
programs.zsh.initExtra = ''
|
programs.zsh.initExtra = ''
|
||||||
# Catppuccin Mocha colors
|
# Catppuccin Mocha colors
|
||||||
local mocha_base="#1E1E2E"
|
local mocha_base="#1E1E2E"
|
||||||
@@ -1355,8 +1361,14 @@ in
|
|||||||
local mocha_flamingo="#F2CDCD"
|
local mocha_flamingo="#F2CDCD"
|
||||||
local mocha_rosewater="#F5E0DC"
|
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%} '
|
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%}'
|
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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,15 +4,20 @@ let
|
|||||||
username = "henrov";
|
username = "henrov";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# Define a toggle option for enabling Zsh
|
||||||
options.mySystem.terminals.zsh.enable =
|
options.mySystem.terminals.zsh.enable =
|
||||||
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
|
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
|
||||||
|
|
||||||
# Use `config` only inside a `config = { ... }` block of the module
|
# Module config block
|
||||||
config = lib.mkIf (lib.getOption config.mySystem.terminals.zsh.enable) {
|
config = lib.mkIf (config.mySystem.terminals.zsh.enable or false) {
|
||||||
|
|
||||||
|
# Home Manager scope for the user
|
||||||
home-manager.users.${username} = {
|
home-manager.users.${username} = {
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
programs.zsh.enableCompletion = true;
|
programs.zsh.enableCompletion = true;
|
||||||
|
|
||||||
|
# Oh-My-Zsh configuration
|
||||||
programs.zsh.ohMyZsh = {
|
programs.zsh.ohMyZsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
theme = "catppuccin-mocha";
|
theme = "catppuccin-mocha";
|
||||||
@@ -23,10 +28,11 @@ in
|
|||||||
"zsh-autosuggestions"
|
"zsh-autosuggestions"
|
||||||
"zsh-completions"
|
"zsh-completions"
|
||||||
"zsh-history-substring-search"
|
"zsh-history-substring-search"
|
||||||
"zsh-syntax-highlighting"
|
# zsh-syntax-highlighting will be sourced in initExtra
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Extra init content
|
||||||
programs.zsh.initExtra = ''
|
programs.zsh.initExtra = ''
|
||||||
# Catppuccin Mocha colors
|
# Catppuccin Mocha colors
|
||||||
local mocha_base="#1E1E2E"
|
local mocha_base="#1E1E2E"
|
||||||
@@ -46,8 +52,14 @@ in
|
|||||||
local mocha_flamingo="#F2CDCD"
|
local mocha_flamingo="#F2CDCD"
|
||||||
local mocha_rosewater="#F5E0DC"
|
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%} '
|
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%}'
|
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