NixOS-Config/modules/home/programs/terminal/zsh/default.nix

45 lines
1.5 KiB
Nix

{ pkgs, ... }:
{
programs.zsh = {
enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = [ "git" ];
};
shellAliases = {
# NixOS aliases
flakedate = "doas nix flake update --flake /etc/nixos";
nhs = "doas nh os switch -R";
nhu = "flakedate && nhs";
ns = "nix-shell -p";
nixclean = "doas nix-store --gc; nix-collect-garbage -d";
nixpurge = "doas nix-collect-garbage --delete-old";
nixoptimize = "doas nix store optimise";
nixscrub = "nixclean; nixpurge; nixoptimize";
# Shortcut aliases
neo = "clear && fastfetch";
ip = "ip -c";
ls = "${pkgs.eza}/bin/eza -a --color=always --group-directories-first --icons";
nls = "/usr/bin/env ls";
cat = "${pkgs.bat}/bin/bat --paging never";
ncat = "/usr/bin/env cat";
copycat = "wl-copy <";
sunshinehost = "WAYLAND_DISPLAY=wayland-1 DISPLAY=:1 sunshine -0";
myip = "curl ifconfig.co";
seneca = "ssh jhampton1@matrix.senecapolytechnic.ca";
};
initExtra = ''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
source ${pkgs.zsh-you-should-use}/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh
setopt HIST_IGNORE_SPACE
setopt RM_STAR_WAIT
'';
};
}