From c0db4f91c089cc39d026ceb407aedce12f8ba3b1 Mon Sep 17 00:00:00 2001 From: KoenDR06 Date: Mon, 1 Sep 2025 19:18:20 +0200 Subject: [PATCH] reformat of files --- modules/apps/terminal/zsh.nix | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/apps/terminal/zsh.nix diff --git a/modules/apps/terminal/zsh.nix b/modules/apps/terminal/zsh.nix new file mode 100644 index 0000000..acabbe4 --- /dev/null +++ b/modules/apps/terminal/zsh.nix @@ -0,0 +1,55 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + cfg = config.horseman.terminal.zsh; +in { + options = { + horseman.apps.terminal.zsh = { + enable = mkEnableOption "The ZSH shell and plugins for it"; + }; + }; + + config = mkIf cfg.enable { + users.defaultUserShell = pkgs.zsh; + environment.shells = with pkgs; [zsh]; + + programs.zsh = { + enable = true; + enableCompletion = true; + + histSize = 10000; + + shellAliases = { + clone-dotfiles = "cp -r /home/horseman/nix-config/config/dotfiles/.\* /home/horseman/"; + rebuild = "function _rebuild(){clone-dotfiles && sudo nixos-rebuild switch --flake \"$@\" && nix fmt *}; _rebuild"; + update = "sudo nix flake update && git commit flake.lock -m 'Update flake.lock: $(date +%y-%m-%d)' && rebuild"; + compose = "sudo docker compose"; + wolpc = "wakeonlan D8:5E:D3:A8:B1:0A"; + capture-config = "nix run github:pjones/plasma-manager > ~/nix-config/modules/wm/plasma/default.nix"; + reboot-to-windows = "sudo efibootmgr -n 0000"; + mkdir = "mkdir -p"; + l = "ls -lAh --group-directories-first"; + zip = "zip -r"; + cat = "bat"; + py = "python3"; + }; + + ohMyZsh = { + enable = true; + plugins = [ + "zsh-interactive-cd" + "git-auto-fetch" + "wd" + ]; + theme = "theme"; + custom = "/home/horseman/nix-config/config/zsh"; + }; + + shellInit = "eval \"$(direnv hook zsh)\""; + }; + }; +}