Configure zsh

This commit is contained in:
muon 2024-06-12 14:56:28 +00:00
parent c9b3277d95
commit 349e926e32
6 changed files with 60 additions and 25 deletions

View file

@ -1,26 +1,43 @@
{ pkgs, lib, config, osConfig, ... }: {
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
{ pkgs, lib, config, ... }:
let
cfg = config.mods.terminal;
history = {
save = 2097152;
size = 2097152;
expireDuplicatesFirst = true;
ignoreDups = true;
ignoreSpace = true;
path = "${config.xdg.dataHome}/zsh/history";
};
aliases = {
la = "ls -lah";
};
zplug = {
in {
options.mods.terminal = {
zsh.enable = lib.mkEnableOption "enables zsh";
};
config = {
programs.starship.enable = true;
programs.zsh = lib.mkIf cfg.zsh.enable {
enable = true;
plugins = [
{ name = "jeffreytse/zsh-vi-mode"; }
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history = {
save = 2097152;
size = 2097152;
expireDuplicatesFirst = true;
ignoreDups = true;
ignoreSpace = true;
path = "${config.xdg.dataHome}/zsh/history";
};
shellAliases = aliases;
plugins = with pkgs; [
{
name = "zsh-vi-mode";
src = zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}
];
};
};
programs.starship.enable = true;
}

View file

@ -1,8 +1,24 @@
{ pkgs, lib, config, ... }: {
options.mods.terminal.tools.enable = lib.mkEnableOption "enables cli tools";
{ pkgs, lib, config, ... }:
let
cfg = config.mods.terminal;
in with lib; {
options.mods.terminal.tools.enable = mkEnableOption "enables cli tools";
config = lib.mkIf config.mods.terminal.tools.enable {
programs.zellij.enable = true;
config = mkIf cfg.tools.enable {
programs.zellij = {
enable = true;
enableZshIntegration = mkIf cfg.zsh.enable true;
};
programs.zoxide = {
enable = true;
enableZshIntegration = mkIf cfg.zsh.enable true;
};
programs.dircolors = {
enable = true;
enableZshIntegration = mkIf cfg.zsh.enable true;
};
home.packages = with pkgs; [
# libraries