196 lines
5.4 KiB
Nix
196 lines
5.4 KiB
Nix
{ config, pkgs, inputs, ... }:
|
|
|
|
{
|
|
home.packages = with pkgs; [
|
|
(writeShellScriptBin "select_command"
|
|
(builtins.readFile ./select_command.sh))
|
|
(writeShellScriptBin "move_avatar" (builtins.readFile ./move_avatar.sh))
|
|
(writeShellScriptBin "update_git_config"
|
|
(builtins.readFile ./update_system_from_git.sh))
|
|
zsh-powerlevel10k
|
|
fzf
|
|
fd
|
|
eza
|
|
zoxide
|
|
bat
|
|
neofetch
|
|
yazi
|
|
zenity
|
|
figlet
|
|
|
|
bat
|
|
ripgrep
|
|
entr
|
|
ddgr
|
|
|
|
cava
|
|
github-copilot-cli
|
|
];
|
|
|
|
home.file.".p10k.zsh".source = ./p10k.zsh;
|
|
|
|
# make it sync
|
|
# home.file.".saved_modes".source =
|
|
# config.lib.file.mkOutOfStoreSymlink ./saved_modes;
|
|
|
|
# home.activation.linkMyFiles = config.lib.dag.entryAfter [ "writeBoundary" ] ''
|
|
# ln -s ${toString ./saved_modes} ~/.saved_modes
|
|
# '';
|
|
|
|
programs.zsh = {
|
|
enable = true;
|
|
|
|
autocd = true;
|
|
enableCompletion = true;
|
|
autosuggestion.enable = true;
|
|
syntaxHighlighting.enable = true;
|
|
|
|
history = {
|
|
append = true;
|
|
ignoreAllDups = true;
|
|
ignoreDups = true;
|
|
saveNoDups = true;
|
|
share = true;
|
|
};
|
|
|
|
plugins = with pkgs; [
|
|
{
|
|
file = "powerlevel10k.zsh-theme";
|
|
name = "powerlevel10k";
|
|
src = "${zsh-powerlevel10k}/share/zsh-powerlevel10k";
|
|
}
|
|
{
|
|
file = "p10k.zsh";
|
|
name = "powerlevel10k-config";
|
|
src = ./p10k.zsh;
|
|
}
|
|
];
|
|
|
|
oh-my-zsh = {
|
|
enable = true;
|
|
plugins = [
|
|
"git"
|
|
"python"
|
|
"ssh"
|
|
"eza"
|
|
"zoxide"
|
|
"fzf"
|
|
"command-not-found"
|
|
"colored-man-pages"
|
|
];
|
|
};
|
|
|
|
sessionVariables = { EDITOR = "nvim"; };
|
|
|
|
shellAliases = {
|
|
ll = "ls -lh";
|
|
la = "ls -la";
|
|
".." = "cd ..";
|
|
"..." = "cd ../..";
|
|
|
|
c = "clear";
|
|
addpath = "export PATH=$PATH:$1";
|
|
tree = "eza --tree";
|
|
kk = "sudo kill -9";
|
|
grepps = "ps -A | grep";
|
|
try = ''f() { nix-shell -p "$@" --run zsh; unset -f f; }; f'';
|
|
|
|
wttr = "curl wttr.in/Ramenki\\?p1MQ";
|
|
|
|
# gitpa = ''
|
|
# f() { git add -A && git commit -m "$@" && git push; unset -f f; }; f
|
|
# '';
|
|
og = ''f() { z github "$@" && code . && exit; unset -f f; }; f'';
|
|
wf = ''f() { watch -t -n1 "$@ | figlet -c -t -f doh"; unset -f f; }; f'';
|
|
|
|
cnfg = "cd nixos-config && code . && exit";
|
|
x = "select_command";
|
|
u = "update_git_config";
|
|
|
|
mv_w = "move_wallpaper";
|
|
next_w = "next_wallpaper";
|
|
next_wr = "next_wallpaper -r";
|
|
next_wf = ''
|
|
next_wallpaper -f $(zenity --title "Pick a wallpaper" --file-selection --file-filter \*.png)'';
|
|
mv_avatar = "move_avatar";
|
|
|
|
t = "todo";
|
|
ta = ''f() { todo add "$*"; todo; unset -f f; }; f'';
|
|
tr = ''f() { todo rm "$@"; todo; unset -f f; }; f'';
|
|
td = ''f() { todo done "$@"; todo; unset -f f; }; f'';
|
|
|
|
s = ''
|
|
(){ local val=''${1:-true} vault=''${2:-default}; local file="$HOME/stats/''${vault}.tsv"; mkdir -p "''${file:h}"; printf "%s\t%s\n" "$(date "+%Y-%m-%d %H:%M:%S")" "$val" >> "$file"; }'';
|
|
|
|
startvm =
|
|
"VBoxManage startvm --type=headless src; socat -,cfmakeraw,echo=0,escape=15 TCP4:localhost:2026";
|
|
};
|
|
|
|
initContent = ''
|
|
(cat ~/.cache/wal/sequences &)
|
|
zstyle ':omz:plugins:eza' 'git-status' yes
|
|
zstyle ':omz:plugins:eza' 'header' yes
|
|
zstyle ':omz:plugins:eza' 'icons' yes
|
|
|
|
ZOXIDE_CMD_OVERRIDE=cd
|
|
|
|
### --- COMPLETION TUNING -----------------------------
|
|
autoload -Uz compinit && compinit
|
|
zstyle ':completion:*' menu select
|
|
zstyle ':completion:*' list-colors ""
|
|
|
|
### --- KEYBINDINGS ----------------------------------
|
|
# bindkey -e # Emacs-style bindings
|
|
# bindkey -v # Vim-style bindings
|
|
|
|
### --- ENVIRONMENT VARS ------------------------------
|
|
export EDITOR="nvim"
|
|
export VISUAL="nvim"
|
|
export PAGER="less"
|
|
export LESS="-R"
|
|
|
|
# --- fzf configuration ---
|
|
if command -v fzf >/dev/null 2>&1; then
|
|
# Enable key bindings and auto-completion
|
|
[ -f "${pkgs.fzf}/share/fzf/key-bindings.zsh" ] && source "${pkgs.fzf}/share/fzf/key-bindings.zsh"
|
|
[ -f "${pkgs.fzf}/share/fzf/completion.zsh" ] && source "${pkgs.fzf}/share/fzf/completion.zsh"
|
|
|
|
# Example of optional fzf tuning
|
|
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
|
|
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
|
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
|
|
fi
|
|
|
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
|
eval "$(zoxide init zsh --cmd cd)"
|
|
|
|
# Автоматически выполнять ls после любого перехода в каталог (только в интерактивной оболочке)
|
|
autoload -Uz add-zsh-hook
|
|
|
|
_ls_after_cd() {
|
|
ls
|
|
}
|
|
|
|
if [[ -o interactive ]]; then
|
|
add-zsh-hook chpwd _ls_after_cd
|
|
fi
|
|
|
|
# mini-neofetch
|
|
|
|
printf "--- Hi, %s! ---\n" "$USER"
|
|
printf "Battery: %s%%\n" "$(cat /sys/class/power_supply/BAT0/capacity 2>/dev/null || echo "N/A")"
|
|
printf "Time: %s\n" "$(date +"%H:%M:%S")"
|
|
printf "Time you live: %s years :)\n" "$(python3 -c "from datetime import datetime; age_years = (datetime.now() - datetime(2006, 6, 16)).total_seconds() / (365.25 * 24 * 3600); print(f'{age_years:.10f}')")"
|
|
|
|
|
|
printf "--\n"
|
|
printf "Task to do: \n"
|
|
todo sort && todo;
|
|
|
|
alias дт='f() { todo add "$*"; todo; unset -f f; }; f'
|
|
'';
|
|
|
|
};
|
|
|
|
}
|