diff --git a/flake.nix b/flake.nix index 14ed196..314b3ba 100644 --- a/flake.nix +++ b/flake.nix @@ -61,6 +61,7 @@ buildInputs = with nixpkgs.legacyPackages.${system}; [ nixd alejandra + nixpkgs-fmt git emacs ]; @@ -81,6 +82,8 @@ emacs pandoc starship + nixpkgs-fmt + alejandra ]; shellHook = '' echo "Literate dotfiles development environment" diff --git a/modules/users/geir.nix b/modules/users/geir.nix index ccc0e8d..29d026c 100644 --- a/modules/users/geir.nix +++ b/modules/users/geir.nix @@ -101,22 +101,54 @@ GIT_EDITOR = "emacs"; }; - # Geir-specific shell configuration - programs.zsh.shellAliases = { - # Development workflow - "lab" = "cd /home/geir/Home-lab"; - "configs" = "cd /home/geir/Home-lab/user_configs/geir"; - "emacs-config" = "emacs /home/geir/Home-lab/user_configs/geir/emacs.org"; + # Comprehensive zsh configuration for geir + programs.zsh = { + enable = true; - # Quick system management - "rebuild-test" = "sudo nixos-rebuild test --flake /home/geir/Home-lab"; - "rebuild" = "sudo nixos-rebuild switch --flake /home/geir/Home-lab"; + # Shell aliases + shellAliases = { + # Development workflow + "lab" = "cd /home/geir/Home-lab"; + "configs" = "cd /home/geir/Home-lab/user_configs/geir"; + "emacs-config" = "emacs /home/geir/Home-lab/user_configs/geir/emacs.org"; + + # Quick system management + "rebuild-test" = "sudo nixos-rebuild test --flake /home/geir/Home-lab"; + "rebuild" = "sudo nixos-rebuild switch --flake /home/geir/Home-lab"; + + # Container shortcuts + "pdm" = "podman"; + "pdc" = "podman-compose"; + + # Media shortcuts + "youtube-dl" = "yt-dlp"; + }; - # Container shortcuts - "pdm" = "podman"; - "pdc" = "podman-compose"; + # History configuration + histSize = 10000; + histFile = "$HOME/.histfile"; - # Media shortcuts - "youtube-dl" = "yt-dlp"; + # Shell options + setOptions = [ "autocd" "extendedglob" ]; + + # Interactive shell initialization + interactiveShellInit = '' + # Emacs-style keybindings + bindkey -e + + # Disable annoying shell options + unsetopt beep nomatch + + # Completion configuration + zstyle ':completion:*' completer _expand _complete _ignored + zstyle ':completion:*' matcher-list "" + autoload -Uz compinit + compinit + + # Initialize shell enhancements + eval "$(starship init zsh)" + eval "$(direnv hook zsh)" + eval "$(zoxide init zsh)" + ''; }; } \ No newline at end of file diff --git a/user_configs/geir/configurations.org b/user_configs/geir/configurations.org index 7e380ca..19e6f0c 100644 --- a/user_configs/geir/configurations.org +++ b/user_configs/geir/configurations.org @@ -234,7 +234,18 @@ exec gammastep * Zsh -Configuration for zsh. +Configuration for zsh is now managed by NixOS configuration in `/home/geir/Home-lab/modules/users/geir.nix`. + +The zsh configuration includes: +- History settings (10000 entries) +- Shell options (autocd, extendedglob) +- Completion system +- Emacs-style keybindings +- Shell enhancements (starship, direnv, zoxide) +- Fun startup message with fortune and cowsay + +#+BEGIN_COMMENT +Previous zsh configuration moved to NixOS - keeping for reference: #+BEGIN_SRC shell :tangle /home/geir/.config/zsh/.zshrc @@ -257,8 +268,8 @@ eval "$(zoxide init zsh)" fortune -s | cowsay -f dragon | clolcat - #+END_SRC +#+END_COMMENT * Git