nixos-config/user/shell/sh.nix
2023-09-16 09:57:28 -05:00

47 lines
1.2 KiB
Nix

{ config, pkgs, ... }:
let
# My shell aliases
myAliases = {
ls = "eza --icons -l -T -L=1";
cat = "bat";
htop = "btm";
fd = "fd -Lu";
w3m = "w3m -no-cookie -v";
nixos-rebuild = "systemd-run --no-ask-password --uid=0 --system --scope -p MemoryLimit=16000M -p CPUQuota=60% nixos-rebuild";
home-manager = "systemd-run --no-ask-password --uid=1000 --user --scope -p MemoryLimit=16000M -p CPUQuota=60% home-manager";
};
in
{
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = myAliases;
initExtra = ''
PROMPT=" %U%F{magenta}%n%f%u@%U%F{blue}%m%f%u:%F{yellow}%~%f
%F{green}%f "
RPROMPT="%F{red}%f%F{yellow}%f%F{green}%f%F{cyan}%f%F{blue}%f%F{magenta}%f%F{white}%f"
[ $TERM = "dumb" ] && unsetopt zle && PS1='$ '
'';
};
programs.bash = {
enable = true;
enableCompletion = true;
shellAliases = myAliases;
};
home.packages = with pkgs; [
neofetch lolcat cowsay
gnugrep gnused
bat eza bottom fd
direnv nix-direnv
];
programs.direnv.enable = true;
programs.direnv.enableZshIntegration = true;
programs.direnv.nix-direnv.enable = true;
}