config/modules/home/shells/zsh/default.nix

158 lines
3.3 KiB
Nix
Raw Normal View History

2024-05-23 20:26:30 +00:00
{
options,
config,
lib,
2024-05-23 20:48:19 +00:00
pkgs,
2024-05-23 20:26:30 +00:00
...
}:
with lib;
with lib.custom; let
cfg = config.shells.zsh;
2024-05-23 20:48:19 +00:00
inherit (builtins) concatStringsSep;
2024-05-23 20:26:30 +00:00
in {
options.shells.zsh = with types; {
enable = mkBoolOpt false "Enable Zsh Configuration";
};
config = mkIf cfg.enable {
2024-05-23 20:48:19 +00:00
programs.zsh = {
enable = true;
sessionVariables = {
LC_ALL = "en_US.UTF-8";
ZSH_AUTOSUGGEST_USE_ASYNC = "true";
SSH_AUTH_SOCK = "/run/user/1000/keyring/ssh";
2025-05-06 20:02:36 -04:00
NH_FLAKE = "/home/zoey/nixos/";
2024-05-23 20:48:19 +00:00
};
2024-12-16 16:39:20 -05:00
# zprof.enable = true;
2024-05-23 20:48:19 +00:00
history = {
save = 2137;
size = 2137;
expireDuplicatesFirst = true;
ignoreDups = true;
ignoreSpace = true;
};
2025-05-06 20:02:36 -04:00
initContent = let
2024-05-23 20:48:19 +00:00
sources = with pkgs; [
"${zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh"
"${zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
"${zsh-f-sy-h}/share/zsh/site-functions/F-Sy-H.plugin.zsh"
"${zsh-you-should-use}/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh"
"${zsh-navigation-tools}/share/zsh/site-functions/zsh-navigation-tools.plugin.zsh"
2024-12-16 16:39:20 -05:00
"${zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
2024-05-23 20:48:19 +00:00
];
source = map (source: "source ${source}") sources;
plugins = concatStringsSep "\n" ([
"${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin"
]
++ source);
in ''
2024-12-16 16:39:20 -05:00
2024-05-23 20:48:19 +00:00
${plugins}
2024-10-06 21:37:22 -04:00
export NIX_LD=$(nix eval --impure --raw --expr 'let pkgs = import <nixpkgs> {}; NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"; in NIX_LD')
2024-05-23 20:48:19 +00:00
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
2025-01-13 17:07:11 -05:00
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
2025-01-19 15:04:19 -05:00
tmux new-session
2025-01-13 17:07:11 -05:00
fi
2024-05-23 20:48:19 +00:00
'';
2024-12-16 16:39:20 -05:00
# oh my zsh
oh-my-zsh = {
enable = true;
plugins = [
"colored-man-pages"
];
};
2024-05-23 20:48:19 +00:00
dirHashes = {
music = "$HOME/Music";
media = "/run/media/$USER";
};
2025-05-19 18:28:46 -04:00
shellAliases = import ../aliases.nix {inherit pkgs lib config;};
2024-05-23 20:48:19 +00:00
};
2025-05-28 19:10:50 -04:00
home.packages = with pkgs;
[
gnumake
# Runs programs without installing them
comma
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# grep replacement
ripgrep
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# ping, but with cool graph
gping
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# dns client
dogdns
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# neofetch but for git repos
onefetch
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# neofetch but for cpu's
cpufetch
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# download from yt and other websites
yt-dlp
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# man pages for tiktok attention span mfs
tealdeer
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# markdown previewer
glow
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# profiling tool
hyperfine
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
imagemagick
ffmpeg-full
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# preview images in terminal
catimg
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# networking stuff
nmap
wget
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# faster find
fd
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# http request thingy
xh
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# generate regex
grex
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# json thingy
jq
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# syncthnig for acoustic people
rsync
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
figlet
# Generate qr codes
qrencode
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
# script kidde stuff
2024-05-23 20:26:30 +00:00
2025-05-28 19:10:50 -04:00
unzip
]
++ (
if !pkgs.stdenv.isDarwin
then [
hcxdumptool
hashcat
]
else []
);
2024-05-23 20:26:30 +00:00
};
}