From 385bc35226db986883022ffbe40e6e32a1a0b9df Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Thu, 19 Mar 2026 07:18:58 +0000 Subject: [PATCH] Working on reshuffling --- Droidnix/README.org | 18 +++++++++++++++--- Droidnix/generated/modules/terminals/zsh.nix | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Droidnix/README.org b/Droidnix/README.org index 84406a75f..a0150ccf5 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -1313,15 +1313,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"; @@ -1332,10 +1337,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" @@ -1355,8 +1361,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 ''; }; }; diff --git a/Droidnix/generated/modules/terminals/zsh.nix b/Droidnix/generated/modules/terminals/zsh.nix index df533eff9..42f3a099b 100644 --- a/Droidnix/generated/modules/terminals/zsh.nix +++ b/Droidnix/generated/modules/terminals/zsh.nix @@ -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 ''; }; };