Files
dotfiles-core/home/shell.nix
T

105 lines
3.0 KiB
Nix

# Universal shell tools and configuration
{ pkgs, config, ... }:
let
name = "${config.shell.name}";
homeDir = "${config.shell.homeDirectory}";
myAliases = {
ll = "ls -hl";
la = "ls -ahl";
cl = "clear; ls -hl";
cla = "clear; ls -ahl";
home-manager = "home-manager -b \"hm-backup\"";
home-switch = "home-manager -b \"hm-backup\" switch --flake ~/.dotfiles";
gdiff = "git diff HEAD";
cdot = "cd ${homeDir}/.dotfiles";
cg = "cd $(git rev-parse --show-toplevel)";
sudo = "sudo TERMINFO=\"$TERMINFO\"";
};
in
{
imports = [
./options.nix
];
home = {
stateVersion = "26.05";
homeDirectory = homeDir;
username = name;
sessionVariables = {
EDITOR = "nvim";
XDG_CONFIG_HOME = "${homeDir}/.config";
DOTFILES = "${homeDir}/.dotfiles";
UTILITY = "${homeDir}/.dotfiles/scripts/utility";
ZVM_VI_INSERT_ESCAPE_BINDKEY = "jk";
};
packages = with pkgs; [
unzip # decompress files
hyfetch # pretty system display tool
tree # recursive directory list
glow # cli markdown display tool
lynx # cli web browser
lua5_5 # scripting language
htop # system monitor
file # identify file type
sops # secret management tool
];
};
programs = {
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = myAliases;
history.size = 10000;
setOptions = [ "NO_BEEP" ];
dotDir = "${config.xdg.configHome}/zsh";
plugins = [
{
name = "vi-mode";
src = pkgs.zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}
];
};
git = {
enable = true;
settings.user = {
inherit name;
email = config.shell.email;
};
};
starship = {
enable = true;
enableZshIntegration = true;
};
yazi = {
enable = true;
shellWrapperName = "y";
enableZshIntegration = true;
plugins = {
git = {
package = pkgs.yaziPlugins.git;
setup = true;
settings = {
order = 1500;
};
};
};
settings = fromTOML ''
[[plugin.prepend_fetchers]]
url = "*"
run = "git"
group = "git"
[[plugin.prepend_fetchers]]
url = "*/"
run = "git"
group = "git"
'';
};
};
}