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= ** =generated/modules/terminals/zsh.nix=
This sets up the zsh in the terminal This sets up the zsh in the terminal
#+BEGIN_SRC nix :tangle generated/modules/terminals/zsh.nix :noweb tangle :mkdirp yes :eval never-html #+BEGIN_SRC nix :tangle generated/modules/terminals/zsh.nix :noweb tangle :mkdirp yes :eval never-html
# terminals/zsh.nix { lib, ... }:
{ lib, pkgs, ... }:
let 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 in
{ {
# Export as a flake module # Top-level toggle for this program
zsh = { config, pkgs, lib, ... }: { options.enableZsh =
options.mySystem.terminals.zsh.enable = lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
config = lib.mkIf (config.mySystem.terminals.zsh.enable or false) { # Configuration applied only if enabled
home-manager.users.${username} = { config = lib.mkIf enableProgram {
programs.zsh.enable = true; myApps = {
programs.zsh.enableCompletion = true; zsh = {
enable = true;
assetsDir = zshAssets;
files = files;
programs.zsh.ohMyZsh = { # Reference default user
user = config.defaultUser or "henrov";
# Zsh-specific settings
ohMyZsh = {
enable = true; enable = true;
theme = "catppuccin-mocha"; theme = "catppuccin-mocha";
plugins = [ plugins = [
@@ -1379,7 +1393,7 @@ in
]; ];
}; };
programs.zsh.initExtra = '' initExtra = ''
# Catppuccin Mocha colors # Catppuccin Mocha colors
local mocha_base="#1E1E2E" local mocha_base="#1E1E2E"
local mocha_surface0="#313244" 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%} ' 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 # Source zsh-syntax-highlighting if present
if [ -f ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then if [ -f ${files."zsh-syntax-highlighting".src} ]; then
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source ${files."zsh-syntax-highlighting".src}
fi fi
''; '';
}; };
+30 -16
View File
@@ -1,21 +1,35 @@
# terminals/zsh.nix { lib, ... }:
{ lib, pkgs, ... }:
let 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 in
{ {
# Export as a flake module # Top-level toggle for this program
zsh = { config, pkgs, lib, ... }: { options.enableZsh =
options.mySystem.terminals.zsh.enable = lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
config = lib.mkIf (config.mySystem.terminals.zsh.enable or false) { # Configuration applied only if enabled
home-manager.users.${username} = { config = lib.mkIf enableProgram {
programs.zsh.enable = true; myApps = {
programs.zsh.enableCompletion = true; zsh = {
enable = true;
assetsDir = zshAssets;
files = files;
programs.zsh.ohMyZsh = { # Reference default user
user = config.defaultUser or "henrov";
# Zsh-specific settings
ohMyZsh = {
enable = true; enable = true;
theme = "catppuccin-mocha"; theme = "catppuccin-mocha";
plugins = [ plugins = [
@@ -29,7 +43,7 @@ in
]; ];
}; };
programs.zsh.initExtra = '' initExtra = ''
# Catppuccin Mocha colors # Catppuccin Mocha colors
local mocha_base="#1E1E2E" local mocha_base="#1E1E2E"
local mocha_surface0="#313244" local mocha_surface0="#313244"
@@ -52,9 +66,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%} ' 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 # Source zsh-syntax-highlighting if present
if [ -f ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then if [ -f ${files."zsh-syntax-highlighting".src} ]; then
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source ${files."zsh-syntax-highlighting".src}
fi fi
''; '';
}; };