Files
nixos-config/home-manager/commands/zsh.nix
T
2026-03-13 20:48:20 -07:00

67 lines
1.4 KiB
Nix

{
config,
configPath,
hostname,
...
}: {
programs = {
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
historySubstringSearch.enable = true;
shellAliases = {
cd = "z";
cat = "bat";
catp = "bat -pP";
find = "fd";
grep = "rg";
lg = "lazygit";
ll = "eza -la";
ls = "eza --color=auto";
lt = "eza --tree";
open = "xdg-open";
locate = "sudo plocate";
tulpn = "sudo netstat -tulpn";
rebuild =
if hostname == "eva-02"
then "sudo darwin-rebuild switch --flake .#eva-02"
else "sudo nixos-rebuild switch --flake /etc/nixos#$(uname -n)";
};
# profileExtra = ''
# export SSH_AUTH_SOCK=~/.1password/agent.sock
# '';
profileExtra =
if hostname == "eva-02"
then ''
export SSH_AUTH_SOCK="~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
''
else ''
export SSH_AUTH_SOCK=~/.1password/agent.sock
'';
initContent = ''
fastfetch
'';
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
};
oh-my-zsh = {
enable = true;
};
};
mcfly = {
enable = true;
fzf.enable = true;
fuzzySearchFactor = 5;
};
};
}