flake/nixos/zsh.nix

64 lines
1.9 KiB
Nix
Executable file

{ pkgs, ... }: {
# starship - an customizable prompt for any shell
#programs.starship = {
#enable = true;
# custom settings
#settings = {
#format = "$all$nix_shell$python$nodejs$lua$golang$rust$php$git_branch$git_commit$git_state$git_status\n$username$hostname$directory";
#add_newline = true;
#aws.disabled = true;
#gcloud.disabled = true;
#line_break.disabled = true;
#};
#};
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableCompletion = true;
enableBashCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellInit = ''
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
'';
histSize = 10000;
histFile = "$HOME/.zsh_history";
ohMyZsh = {
enable = true;
theme = "agnoster";
};
shellAliases = let ezaArgs = "--time-style='+%Y-%m-%d %H:%M' --icons";
in {
ff = "fastfetch";
neofetch = "fastfetch";
nf = "fastfetch";
lg = "lazygit";
lad = "lazydocker";
cat = "bat";
l = "eza -lhg ${ezaArgs}";
la = "eza -lAh ${ezaArgs}";
ll = "eza -lhg ${ezaArgs}";
ls = "eza ${ezaArgs}";
lsa = "eza -lah ${ezaArgs}";
nixrc = "$EDITOR /etc/nixos";
upd =
"sudo nixos-generate-config --dir /etc/nixos/hosts && sudo rm /etc/nixos/hosts/configuration.nix && sudo mv /etc/nixos/hosts/hardware-configuration.nix /etc/nixos/hosts/$(hostname).nix && git -C /etc/nixos --git-dir=/etc/nixos/.git add /etc/nixos/hosts/$(hostname).nix && sudo nixos-rebuild switch";
taildrop = "tailscale file";
forgejo-runner = "act_runner";
runactions =
"act_runner exec --default-actions-url=https://www.coastalcommits.com --gitea-instance=https://www.coastalcommits.com";
c = "clear";
# alias sudo to itself so user aliases can be sudoed
sudo = "sudo ";
s = "sudo ";
};
};
}