{ pkgs, ... }: { environment.systemPackages = with pkgs; [ any-nix-shell ]; 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 } if (( $+commands[kitten] )); then alias "ssh"="kitten ssh" fi source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh ''; promptInit = # zsh '' ${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin ''; 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://c.csw.im --style=fancy"; cb = "fj --host https://codeberg.org --style=fancy"; eza = "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://c.csw.im --gitea-instance=https://c.csw.im"; uvr = "uv run"; ns = "nix-shell"; edit = "_edit"; e = "edit"; c = "clear"; sudo = "sudo "; s = "sudo"; }; histSize = 10000; histFile = "$HOME/.zsh_history"; }; # starship - a customizable prompt for any shell programs.starship = { enable = true; # custom settings settings = { format = "[](bg:#1e1e2e fg:#a6e3a1)$username$hostname[](fg:#a6e3a1 bg:#89b4fa)$directory[](fg:#89b4fa bg:#cba6f7)$direnv[](fg:#cba6f7 bg:#f9e2af)$git_branch$git_status[](fg:#f9e2af bg:#1e1e2e)$character"; username = { show_always = true; format = "[ $user@]($style)"; style_user = "fg:#313244 bg:#a6e3a1"; style_root = "fg:#313244 bg:#a6e3a1"; }; hostname = { ssh_only = false; format = "[$hostname $ssh_symbol]($style)"; style = "fg:#313244 bg:#a6e3a1"; }; directory = { format = "[ $path ]($style)"; style = "fg:#313244 bg:#89b4fa"; }; git_branch = { format = "[ $symbol$branch(:$remote_branch) ]($style)"; symbol = "  "; style = "fg:#313244 bg:#f9e2af"; }; direnv = { symbol = "󱄅 "; format = "[ $symbol$loaded/$allowed ]($style)"; disabled = false; style = "fg:#313244 bg:#cba6f7"; }; git_status = { format = "[$all_status]($style)"; style = "fg:#313244 bg:#f9e2af"; }; git_metrics = { format = "([+$added]($added_style))[]($added_style)"; added_style = "fg:#313244 bg:#f9e2af"; deleted_style = "fg:bright-red bg:235"; disabled = false; }; hg_branch = { format = "[ $symbol$branch ]($style)"; symbol = " "; }; cmd_duration = { format = "[  $duration ]($style)"; style = "fg:bright-white bg:18"; }; character = { success_symbol = "[ ](#a6e3a1) "; error_symbol = "[ ✗](#f38ba8) "; }; add_newline = false; }; }; }