switch back to zsh

I like `xonsh` and all, but integrating it with neovim without incurring
a major performance penalty is difficult to say the least. I think
switching back to `zsh` is my best option to solve this issue for now.
This commit is contained in:
cswimr 2025-02-04 11:39:40 -06:00
parent 184afebce1
commit 95ac8522db
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
9 changed files with 362 additions and 14 deletions

View file

@ -10,7 +10,85 @@
any-nix-shell
];
users.defaultUserShell = pkgs.xonsh;
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableBashCompletion = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellInit = # zsh
''
# Directory containing the Python scripts
SCRIPT_DIR="/etc/nixos/scripts/py"
# Ensure the directory exists
if [[ ! -d "$SCRIPT_DIR" ]]; then
echo "Directory $SCRIPT_DIR does not exist."
return 1
fi
# Register aliases for each .py file in the directory
for script in "$SCRIPT_DIR"/*.py; do
[[ -f "$script" ]] || continue # Skip if no .py files found
script_name="''${script##*/}" # Extract filename
alias_name="''${script_name%.py}" # Strip .py extension
alias "$alias_name"="\"$script\""
done
_edit() {
local args=("$@")
if [[ ''${#args[@]} -eq 0 ]]; then
args=(".")
fi
if [[ -n "$SSH_CONNECTION" ]]; then
command "$EDITOR" "''${args[@]}"
else
command "$VISUAL" "''${args[@]}"
fi
}
'';
shellAliases = {
ff = "fastfetch";
neofetch = "fastfetch";
nf = "fastfetch";
lg = "lazygit";
lad = "lazydocker";
clip = "wl-copy";
clp = "clip";
paste = "wl-paste";
cat = "bat";
git = "hub";
cc = "fj --host=https://www.coastalcommits.com --style=fancy";
cb = "fj --host https://codeberg.org --style=fancy";
eza = "--time-style=long-iso --icons=auto --hyperlink";
l = "eza -lhg";
la = "eza -lAh";
ll = "l";
ls = "eza";
lsa = "eza -lah";
tree = "eza --tree --git-ignore";
nixpkgs-update = "nix run ;--option extra-substituters 'https://nix-community.cachix.org/' --option extra-trusted-public-keys 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' github:ryantm/nixpkgs-update --";
nixrc = "edit /etc/nixos";
taildrop = "tailscale file";
forgejo-runner = "act_runner";
runactions = "act_runner exec --default-actions-url=https://www.coastalcommits.com --gitea-instance=https://www.coastalcommits.com";
uvr = "uv run";
ns = "nix-shell";
edit = "_edit";
e = "edit";
c = "clear";
sudo = "sudo ";
s = "sudo";
};
histSize = 10000;
histFile = "$HOME/.zsh_history";
};
programs.xonsh =
let
bashcfg = config.programs.bash;