nixos-config/modules/home/zsh.nix

115 lines
3.4 KiB
Nix
Raw Normal View History

2024-04-13 13:56:13 +02:00
{ hostname, config, pkgs, host, ...}:
2023-11-05 17:56:55 +01:00
{
2024-06-21 09:40:23 +02:00
programs = {
zsh = {
2023-11-05 11:40:44 +01:00
enable = true;
2024-06-21 09:40:23 +02:00
autocd = true;
autosuggestion.enable = true;
enableCompletion = true;
# enableGlobalCompInit = true; # Should be a thing according to NixOS options but is not a thing?
2023-12-16 00:05:49 +01:00
2024-06-21 09:40:23 +02:00
localVariables = {
# Looks like this: '~/some/path > '
PS1 = "%F{magenta}%~%f > ";
RPROMPT = "%F{magenta}%m";
2024-06-21 09:40:23 +02:00
# Gets pushed to the home directory otherwise
LESSHISTFILE = "/dev/null";
# Make Vi mode transitions faster (in hundredths of a second)
# KEYTIMEOUT = 1;
LANG = "en_US.UTF-8";
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=#808080";
ZSH_AUTOSUGGEST_USE_ASYNC = 1;
HISTSIZE = 100000;
SAVEHIST = 100000;
HISTFILE = "~/.zsh_history";
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE = 1;
2024-06-21 09:40:23 +02:00
};
2023-11-05 11:40:44 +01:00
# setOptions = [
# # Corrections
# "CORRECT"
#
# # History stuff
# "APPEND_HISTORY"
# "INC_APPEND_HOSTORY"
# "SHARE_HISTORY"
# "EXTENDED_HISTORY"
# "HIST_REDUCT_BLANKS"
# "HIST_IGNORE_SPACE"
#
# # Disable annoying beep
# "NO_BEEP"
# # Fix comments
# "INTERACTIVE_COMMENTS"
# ];
2024-06-21 09:40:23 +02:00
shellAliases = {
2024-06-21 09:41:58 +02:00
ls = "eza -lh --git";
la = "eza -A --git";
ll = "eza -l --git";
2024-06-21 09:40:23 +02:00
lla = "eza -lA";
2024-07-08 18:45:18 +02:00
":q" = "exit";
2024-06-21 09:40:23 +02:00
ezit = "exit";
2024-06-30 01:26:13 +02:00
wlc = "wl-copy";
2024-06-21 09:40:23 +02:00
yt-dlp-audio = "yt-dlp -f 'ba' -x --audio-format mp3";
open = "xdg-open";
tree = "eza --icons --tree --group-directories-first";
2024-07-22 15:19:52 +02:00
# nvim = "nix run /home/liv/Development/nixvim --";
vim = "nvim";
2024-06-21 09:40:23 +02:00
doas = "sudo";
2023-11-05 11:40:44 +01:00
2024-06-21 09:40:23 +02:00
# NixOS
ns = "nix-shell --run zsh";
nix-shell = "nix-shell --run zsh";
nix-switch = "sudo nixos-rebuild switch --flake ~/nixos-config#${host}";
nix-switch-upgrade = "sudo nixos-rebuild switch --upgrade --flake ~/nixos-config#${host}";
2024-06-21 09:40:23 +02:00
nix-flake-update = "sudo nix flake update ~/nixos-config#";
nix-clean = "sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/* && nix-collect-garbage && nix-collect-garbage -d";
};
2023-11-05 21:55:37 +01:00
2024-06-21 09:40:23 +02:00
plugins = with pkgs; [
{
name = "zsh-syntax-highlighting";
src = fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.6.0";
sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4";
};
file = "zsh-syntax-highlighting.zsh";
}
{
name = "zsh-abbr";
src = fetchFromGitHub {
owner = "olets";
repo = "zsh-abbr";
rev = "752e9fcc4daff680545c30f8f857913d66f6f5e6";
sha256 = "sha256-HY/F43fpWn1PBYb2c+qp0CyF3hpSFHUZdZLZRS1d9Yc=";
};
file = "zsh-abbr.sh";
}
{
name = "zsh-autopair";
src = fetchFromGitHub {
owner = "hlissner";
repo = "zsh-autopair";
rev = "34a8bca0c18fcf3ab1561caef9790abffc1d3d49";
sha256 = "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1";
};
file = "autopair.zsh";
}
];
2023-11-05 11:40:44 +01:00
};
2023-12-06 22:05:30 +01:00
2024-06-21 09:40:23 +02:00
fzf = {
enable = true;
enableZshIntegration = true;
};
zoxide = {
enable = true;
enableZshIntegration = true;
};
2023-12-06 22:05:30 +01:00
};
2023-11-05 11:40:44 +01:00
}