nix-config/overhaul/modules/terminal/zsh.nix
2025-02-10 22:16:14 +01:00

56 lines
1.3 KiB
Nix

{
inputs,
outputs,
lib,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf mkOption types;
cfg = config.horseman.base.locale;
in {
options = {
horseman.terminal.zsh = {
enable = mkEnableOption "Enable ZSH and all associated plugins";
};
};
config = mkIf cfg.enable {
services.lorri.enable = true;
users.defaultUserShell = pkgs.zsh;
environment.shells = with pkgs; [ zsh ];
programs.zsh = {
enable = true;
enableCompletion = true;
histSize = 10000;
shellAliases = {
clone-dotfiles = "cp /home/horseman/nix-config/config/dotfiles/.\* /home/horseman/";
rebuild = "nix fmt && clone-dotfiles && sudo nixos-rebuild switch --flake";
update = "sudo nix flake update && rebuild";
compose = "sudo docker compose";
wolpc = "wakeonlan D8:5E:D3:A8:B1:0A";
capture-config = "nix run github:pjones/plasma-manager > ~/nix-config/home-manager/plasma.nix";
reboot-to-windows = "sudo efibootmgr -n 0000";
mkdir = "mkdir -p";
};
ohMyZsh = {
enable = true;
plugins = [
"git"
"zsh-interactive-cd"
"python"
"git-auto-fetch"
"wd"
];
theme = "jonathan";
};
shellInit = "eval \"$(direnv hook zsh)\"";
};
};
}