2023-09-11 20:23:04 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2019-03-20 02:57:59 +01:00
|
|
|
with lib;
|
2024-11-20 20:32:38 +01:00
|
|
|
mkIf (elem "zsh" config.machine.conffiles) {
|
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
autosuggestions.enable = true;
|
|
|
|
syntaxHighlighting.enable = true;
|
|
|
|
shellAliases = {
|
|
|
|
cat = ''bat --paging=never --theme="Solarized (dark)"'';
|
|
|
|
less = ''bat --paging=always --style=changes --color=always --theme="Solarized (dark)"'';
|
|
|
|
ls = "eza";
|
|
|
|
l = "eza -abgHhl@ --git --color=always --group-directories-first";
|
|
|
|
tree = "exa --tree --color=always";
|
|
|
|
ustrip = "sed -e '/\.service\|\.timer\|\.target\|\.socket\|\.slice\|\.scope\|\.path\|\.mount\|\.device)/!d' -e 's/loaded.*$//g' -e 's/^ \|^● //g'";
|
|
|
|
lsunits = "systemctl list-units | ustrip";
|
|
|
|
};
|
2019-03-20 02:57:59 +01:00
|
|
|
|
2024-11-20 20:32:38 +01:00
|
|
|
shellInit = ''
|
|
|
|
function ll() { eza -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" }
|
|
|
|
function lln() { eza -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" -n }
|
|
|
|
function lszip() { unzip -l $@ 2>&1 | sed -e "1,3d" -e "s/^.*:.. *//g" | head --lines=-2 }
|
|
|
|
function rwhich() { realpath $(which $@) }
|
|
|
|
function cdf() { cd $(rwhich $@ | sed "s/$@$//") }
|
|
|
|
function sfu() { lsunits | rg -i $@ }
|
|
|
|
function map() { for f in "$\{@:2\}"; do; eval $1 \"$f\"; done }
|
|
|
|
'';
|
2021-11-24 22:47:40 +01:00
|
|
|
|
2024-11-20 20:32:38 +01:00
|
|
|
ohMyZsh = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [
|
|
|
|
"cabal"
|
|
|
|
"docker"
|
|
|
|
"gitfast"
|
|
|
|
"python"
|
|
|
|
"pip"
|
|
|
|
"sudo"
|
|
|
|
"systemd"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
theme = "gentoo";
|
2019-02-26 13:44:40 +01:00
|
|
|
};
|
2024-11-20 20:32:38 +01:00
|
|
|
};
|
|
|
|
}
|