working on zsh

This commit is contained in:
2026-03-11 14:21:24 +01:00
parent cf816ede62
commit 9146ac0124
8812 changed files with 810 additions and 587 deletions
@@ -7,7 +7,7 @@
}:
let
moduleName = "install-flatpaks";
flatpakConfPath = "${flakeRoot}/assets/common/apps/flatpaks.conf";
flatpakConfPath = "${flakeRoot}/assets/system/apps/flatpaks.conf";
raw = builtins.readFile flatpakConfPath;
# Explicit "\n" so we never accidentally split into characters
rawLines = lib.splitString "\n" raw;
@@ -1,6 +1,6 @@
{ config, lib, pkgs, flakeRoot, inputs, ... }:
let
packagesConfPath = "${flakeRoot}/assets/common/apps/packages.conf";
packagesConfPath = "${flakeRoot}/assets/system/apps/packages.conf";
raw = builtins.readFile packagesConfPath;
# IMPORTANT: explicit "\n" so we never accidentally split into characters
rawLines = lib.splitString "\n" raw;
@@ -10,10 +10,10 @@ in
# Copy the actual kitty.conf (not a symlink)
xdg.configFile."kitty/kitty.conf".text = lib.concatStringsSep "\n" [
(builtins.readFile "${flakeRoot}/assets/common/conf/kitty/kitty.conf")
(builtins.readFile "${flakeRoot}/assets/system/conf/kitty/kitty.conf")
];
# Copy the theme file
xdg.configFile."kitty/Catppuccin-Mocha.conf".source = "${flakeRoot}/assets/common/conf/kitty/Catppuccin-Mocha.conf";
xdg.configFile."kitty/Catppuccin-Mocha.conf".source = "${flakeRoot}/assets/system/conf/kitty/Catppuccin-Mocha.conf";
};
}
@@ -4,7 +4,7 @@
programs.starship = {
enable = true;
settings = {
configFile = "${flakeRoot}/assets/common/conf/starship.toml";
configFile = "${flakeRoot}/assets/system/conf/starship.toml";
};
};
};
@@ -1,36 +1,91 @@
{ config, pkgs, lib, user, flakeRoot, ... }:
let
zshConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/zsh";
assetsDir = "${flakeRoot}/assets/common/conf/zsh";
in
{ lib, config, pkgs, ... }:
{
home-manager.users.${user.username} = {
home.packages = with pkgs; [
zsh-syntax-highlighting
];
# --- NixOS Configuration ---
environment.systemPackages = with pkgs; [
zsh
git
docker
];
# --- Home Manager Configuration ---
home-manager.users.henrov = {
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
# Use oh-my-zsh only for themes (optional)
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = [
"git"
"docker"
"kubectl"
"history"
"command-not-found"
"extract"
];
};
shellAliases = {
ls = "exa --icons -a --group-directories-first";
ll = "exa --icons -la --group-directories-first";
};
theme = "agnoster"; # Fallback
customThemes = {
catppuccin-mocha = ''
# Catppuccin Mocha colors
local mocha_base="#1E1E2E"
local mocha_surface0="#313244"
local mocha_text="#CDD6F4"
local mocha_lavender="#B4BEFE"
local mocha_blue="#89B4FA"
local mocha_sapphire="#74C7EC"
local mocha_teal="#94E2D5"
local mocha_green="#A6E3A1"
local mocha_yellow="#F9E2AF"
local mocha_peach="#FAB387"
local mocha_maroon="#EBA0AC"
local mocha_red="#F38BA8"
local mocha_mauve="#CBA6F7"
local mocha_pink="#F5C2E7"
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%}'
# Git prompt
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[$mocha_yellow]%}(%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[$mocha_yellow]%})%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[$mocha_red]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[$mocha_green]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[$mocha_blue]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[$mocha_blue]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[$mocha_pink]%}?%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[$mocha_sapphire]%}+%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg[$mocha_red]%}!%{$reset_color%}"
# Virtualenv/pyenv
ZSH_THEME_VIRTUAL_ENV_PREFIX="(%{$fg[$mocha_teal]%}"
ZSH_THEME_VIRTUAL_ENV_SUFFIX="%{$reset_color%})"
# Right prompt with Git status
RPROMPT='$(git_prompt_info) %{$fg[$mocha_green]%}%T%{$reset_color%}'
'';
};
theme = "catppuccin-mocha";
};
# Declare all plugins via Nixpkgs for reproducibility
plugins = with pkgs.zshPlugins; [
zsh-autosuggestions
zsh-syntax-highlighting
zsh-completions
zsh-history-substring-search
zsh-you-should-use # Optional: Suggests aliases
];
# Source plugins that need explicit activation
initExtra = ''
source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh
ZSH_THEME="catppuccin-mocha"
'';
};
# Use the .zshrc file from assets
xdg.configFile."zsh/.zshrc".source = "${assetsDir}/.zshrc";
# Home Manager packages (optional, if not already in systemPackages)
home.packages = with pkgs; [
direnv
git-extras
];
};
}
+1 -1
View File
@@ -12,7 +12,7 @@
# XDG Desktop Portal settings for better application integration
xdg.portal = {
enable = true;
config.common.default = [ "hyprland" "gtk" ];
config.system.default = [ "hyprland" "gtk" ];
};
# Environment variables for a Wayland session