Working on reshuffling

This commit is contained in:
2026-03-19 09:32:46 +00:00
parent 2447e46d08
commit f6d994a06f
2 changed files with 60 additions and 32 deletions
+30 -16
View File
@@ -1348,24 +1348,38 @@ in
** =generated/modules/terminals/zsh.nix=
This sets up the zsh in the terminal
#+BEGIN_SRC nix :tangle generated/modules/terminals/zsh.nix :noweb tangle :mkdirp yes :eval never-html
# terminals/zsh.nix
{ lib, pkgs, ... }:
{ lib, ... }:
let
username = "henrov";
# --- Program-specific values ---
programName = "zsh";
zshAssets = ../../../assets/system/conf/${programName};
zshFiles = builtins.readDir zshAssets;
files = lib.genAttrs (builtins.attrNames zshFiles) (name: {
src = "${zshAssets}/${name}";
});
# Enable toggle for this program
enableProgram = true;
in
{
# Export as a flake module
zsh = { config, pkgs, lib, ... }: {
options.mySystem.terminals.zsh.enable =
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
# Top-level toggle for this program
options.enableZsh =
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
config = lib.mkIf (config.mySystem.terminals.zsh.enable or false) {
home-manager.users.${username} = {
programs.zsh.enable = true;
programs.zsh.enableCompletion = true;
# Configuration applied only if enabled
config = lib.mkIf enableProgram {
myApps = {
zsh = {
enable = true;
assetsDir = zshAssets;
files = files;
programs.zsh.ohMyZsh = {
# Reference default user
user = config.defaultUser or "henrov";
# Zsh-specific settings
ohMyZsh = {
enable = true;
theme = "catppuccin-mocha";
plugins = [
@@ -1379,7 +1393,7 @@ in
];
};
programs.zsh.initExtra = ''
initExtra = ''
# Catppuccin Mocha colors
local mocha_base="#1E1E2E"
local mocha_surface0="#313244"
@@ -1402,9 +1416,9 @@ in
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
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
# Source zsh-syntax-highlighting if present
if [ -f ${files."zsh-syntax-highlighting".src} ]; then
source ${files."zsh-syntax-highlighting".src}
fi
'';
};