2023-06-30 22:10:42 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
options.components.terminal.zsh.enable = mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = config.components.terminal.enable;
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (config.components.terminal.zsh.enable) {
|
|
|
|
|
|
|
|
home-manager.users =
|
|
|
|
let
|
|
|
|
zshConfig = {
|
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
defaultKeymap = "viins";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
mainUser = zshConfig;
|
|
|
|
root = zshConfig;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.zsh = {
|
|
|
|
|
|
|
|
enable = true;
|
|
|
|
enableCompletion = true;
|
|
|
|
syntaxHighlighting.enable = true;
|
|
|
|
|
|
|
|
shellAliases = {
|
|
|
|
ls = "ls --color=tty";
|
|
|
|
l = "ls -CFh";
|
|
|
|
la = "ls -Ah";
|
|
|
|
ll = "ls -lh";
|
|
|
|
lt = "ls -lct --reverse";
|
|
|
|
less = "less -S";
|
|
|
|
top = "htop";
|
|
|
|
version = "date '+%Y%m%d%H%M%S'";
|
|
|
|
vclip = "xclip -selection clipboard";
|
|
|
|
df = "df -h";
|
|
|
|
timestamp = "date +%Y%m%d%H%M%S";
|
|
|
|
nix-show-garbadge-roots = "ls -lh /nix/var/nix/gcroots/auto/";
|
|
|
|
};
|
|
|
|
|
2023-07-05 23:01:42 +02:00
|
|
|
interactiveShellInit = ''
|
|
|
|
kpaste() {
|
|
|
|
arg=cat
|
|
|
|
if [[ $# -ne 0 ]]; then
|
|
|
|
arg+=("''${@}")
|
|
|
|
elif [[ -t 0 ]] && [[ -o interactive ]]; then
|
|
|
|
arg=(wl-paste)
|
|
|
|
fi
|
|
|
|
"''${arg[@]}" | curl -sS http://p.r --data-binary @- | \
|
|
|
|
sed '$ {p;s|http://p.r|https://p.krebsco.de|}'
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2023-06-30 22:10:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|