{ config, pkgs, lib, ... }: let nixosScript = '' nixos() { case $1 in update | up) if [ "$#" -gt 1 ]; then echo "Error: 'nixos update' takes no additional arguments." return 1 fi nh os switch $HOME/.nix --ask ;; upgrade) if [ "$#" -gt 1 ]; then echo "Error: 'nixos upgrade' takes no additional arguments." return 1 fi nh os switch $HOME/.nix -u --ask ;; clean) nh clean all --verbose ;; config) hx ~/.nix/"$2" ;; *) echo "Usage: nixos update | up || nixos upgrade || nixos config " ;; esac } nix() { if [[ $1 == "develop" ]]; then shift local flake case $1 in python) flake="$HOME/.nix#python" shift ;; nim) flake="$HOME/.nix#nim" shift ;; js) flake="$HOME/.nix#js" shift ;; *) flake="$1" shift ;; esac command nix develop "$flake" -c zsh else command nix "$@" fi } _nixos_autocomplete() { _arguments \ '1: :->subcmd' \ '2: :->files' case $state in subcmd) local -a commands commands=("update" "config") _describe 'command' commands ;; files) # Check if the subcommand is config. if [[ $words[2] == "config" ]]; then _files -W "$HOME/.nix" -g '*' fi ;; esac } compdef _nixos_autocomplete nixos ''; in { programs.zsh = { enable = true; autosuggestion.enable = true; enableCompletion = true; syntaxHighlighting.enable = true; shellAliases = { ls = "eza --icons=always --color=always"; ll = "eza -a --long --icons=always --color=always --no-time"; lt = "eza -a --long --tree --icons=always --color=always --no-time"; cat = "bat"; mk = "(){ mkdir -p $1 && cd $1 }"; grep = "grep --color=auto"; mv = "mv -i"; cp = "cp -i"; rm = "rm -i"; fetch = "fastfetch -c examples/7"; nix-shell = "nix-shell --run $SHELL"; }; initContent = '' ${nixosScript}; eval "$(atuin init zsh)" eval "$(starship init zsh)" ''; }; programs = { starship = { enable = true; }; atuin = { enable = true; enableZshIntegration = true; }; }; }