Files
dotfiles/nixos/home/ada/zsh.nix
T
Dmitry 17b0cdfbac feat: add comprehensive NixOS configuration documentation and structure
- Introduced `08-structure.md` detailing project structure, main files, and versioning.
- Created `README.md` for documentation overview and quick start guide.
- Added user-specific configurations for Alacritty, Vim, Micro, Git, Zsh, Tmux, and tools.
- Implemented system modules for desktop environment (KDE Plasma), audio (PipeWire), networking, and services (OpenSSH, GnuPG).
- Configured Nix settings with flakes support and garbage collection.
- Established user management for `ada` with necessary groups and shell settings.
- Enabled VirtualBox guest additions for improved VM experience.
2026-03-10 13:10:52 +03:00

155 lines
4.1 KiB
Nix

{ config, pkgs, ... }:
{
# ZSH - расширенная оболочка
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
# Переменные окружения
sessionVariables = {
EDITOR = "micro";
VISUAL = "code --wait";
PAGER = "less";
# XDG Base Directories
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_STATE_HOME = "$HOME/.local/state";
# История
HISTFILE = "$XDG_STATE_HOME/zsh/history";
HISTSIZE = "50000";
SAVEHIST = "50000";
# Less
LESS = "-R -M -i -j10";
# Цвета
CLICOLOR = "1";
# FZF
FZF_DEFAULT_OPTS = "--height 40% --layout=reverse --border --inline-info";
FZF_DEFAULT_COMMAND = "fd --type f --hidden --follow --exclude .git";
# Go
GOPATH = "$HOME/go";
# Rust
CARGO_HOME = "$HOME/.cargo";
# Python
PYTHONDONTWRITEBYTECODE = "1";
};
shellAliases = {
# Навигация
".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";
"....." = "cd ../../../..";
# Быстрый доступ
dl = "cd ~/Downloads";
dt = "cd ~/Desktop";
doc = "cd ~/Documents";
dev = "cd ~/dev";
# Списки файлов (eza)
ls = "eza --icons --group-directories-first";
ll = "eza -l --icons --group-directories-first --git";
la = "eza -la --icons --group-directories-first --git";
lt = "eza --tree --level=2 --icons";
l = "eza -lah --icons --group-directories-first --git";
# Безопасность
rm = "rm -i";
cp = "cp -i";
mv = "mv -i";
# Системные
grep = "grep --color=auto";
df = "df -h";
du = "du -h";
free = "free -h";
# Сеть
ping = "ping -c 5";
ports = "netstat -tulanp";
localip = "ip -4 addr show | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}' | grep -v 127.0.0.1";
# NixOS - используем nh для удобства
nixos-rebuild = "nh os switch";
nixos-test = "nh os test";
nixos-boot = "nh os boot";
nixos-update = "cd /home/ada/.dotfiles/nixos && nix flake update && nh os switch";
nixos-list = "nh os list";
# Git
g = "git";
gs = "git status";
gst = "git --no-pager status";
ga = "git add";
gaa = "git add .";
gc = "git commit";
gcm = "git commit -m";
gp = "git push";
gpl = "git pull";
gd = "git diff";
gco = "git checkout";
gb = "git branch";
gl = "git log --oneline --graph --decorate";
glog = "git log --oneline --graph --decorate --all";
# Docker
d = "docker";
dc = "docker-compose";
dps = "docker ps";
dpsa = "docker ps -a";
di = "docker images";
dex = "docker exec -it";
dlog = "docker logs -f";
# Kubectl
k = "kubectl";
kgp = "kubectl get pods";
# Lazy инструменты
lg = "lazygit";
};
# История
history = {
size = 50000;
save = 50000;
path = "$HOME/.local/state/zsh/history";
ignoreDups = true;
ignoreSpace = true;
share = true;
};
initExtra = ''
# Включить zoxide (умная навигация)
eval "$(zoxide init zsh)"
# Включить direnv
eval "$(direnv hook zsh)"
# FZF конфигурация с Catppuccin цветами
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"
# FZF используем fd вместо find
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# Создать директорию для истории если не существует
[[ ! -d "$(dirname $HISTFILE)" ]] && mkdir -p "$(dirname $HISTFILE)"
'';
};
}