45 lines
1003 B
Nix
45 lines
1003 B
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
home.file.".zsh/fastfetch.jsonc".source = ./fastfetch/config.jsonc;
|
|
|
|
programs.zsh = {
|
|
enable = true;
|
|
|
|
oh-my-zsh = {
|
|
enable = true;
|
|
theme = "agnoster";
|
|
};
|
|
|
|
initContent = ''
|
|
# Use kitty's ssh helper if running inside kitty
|
|
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
|
|
|
|
dex() {
|
|
local container
|
|
|
|
container=$(
|
|
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}' \
|
|
| tail -n +2 \
|
|
| fzf \
|
|
--header='Select container' \
|
|
--height=80% \
|
|
--layout=reverse \
|
|
--border \
|
|
--preview 'docker logs --tail=30 {1}' \
|
|
| awk '{print $1}'
|
|
)
|
|
|
|
[ -z "$container" ] && return 0
|
|
docker exec -it "$container" sh -c '
|
|
if command -v bash >/dev/null 2>&1; then
|
|
exec bash
|
|
else
|
|
exec sh
|
|
fi
|
|
'
|
|
}
|
|
'';
|
|
};
|
|
}
|