Files
dotfiles/home-modules/fish.nix
Lennart J. Kurzweg (Nx2) 428c531415 homeACE
2024-05-05 12:32:57 +02:00

90 lines
3.7 KiB
Nix
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{ config, pkgs, lib, system, user, allowed, secrets, ... }:
lib.mkIf (user != "tv")
{
home.packages = with pkgs; [
fish
any-nix-shell
(writeShellScriptBin "nxfetch" ''
logo=$(echo -e "
OS
DE/WM
TERM
SHELL
ISHELL
KERNEL
EDITOR
TFM
PROMPT
" | lolcat --force)
msg="
$(echo -e "$logo" | sed -n 3p): $(cat /etc/*-release | grep PRETTY_NAME | cut -c 14- | rev | cut -c 2- | rev)
$(echo -e "$logo" | sed -n 4p): ''${XDG_CURRENT_DESKTOP^}
$(echo -e "$logo" | sed -n 5p): ''${TERM^}
$(echo -e "$logo" | sed -n 6p): $(bash --version | head --lines 1 | cut -f -4 -d' ')
$(echo -e "$logo" | sed -n 7p): fish $(fish --version | rev | cut -f 1 -d' ' | rev)
$(echo -e "$logo" | sed -n 8p): ''$(uname -r)
$(echo -e "$logo" | sed -n 9p): ''${EDITOR}
$(echo -e "$logo" | sed -n 10p): $(yazi --version)
$(echo -e "$logo" | sed -n 11p): $(starship --version | head -n 1)
"
echo -e "$msg"
'')
];
# bash>>fish is set in users system module
programs.fish = {
enable = true;
shellAliases = {
ls = "eza --icons --git --smart-group --group-directories-first";
ll = "eza --icons --git --smart-group --group-directories-first --long";
la = "eza --icons --git --smart-group --group-directories-first --all";
lla = "eza --icons --git --smart-group --group-directories-first --all --long";
lt = "eza --icons --git --smart-group --group-directories-first --long --tree";
ltd = "eza --icons --git --smart-group --group-directories-first --long --tree -D";
lt2 = "eza --icons --git --smart-group --group-directories-first --long --tree -L 2";
sr = "sudo reboot";
nf = "neofetch";
nxf = "nxfetch";
nn = "nano";
m = "micro";
p = "python";
ipy = "ipython";
c = "codium";
g = "git";
# gst = "git status";
gps = "git push";
gpl = "git pull";
gad = "git add";
gcm = "git commit -m ";
gsh = "git stash";
gsp = "git stash pop";
glg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all";
gll = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'";
gmt = "git_monitor";
gsw = "git switch";
gft = "git fetch";
ns = "nix-shell";
lzd = "lazydocker";
d = "docker";
dcmp = "docker compose";
code = "codium";
# ya = "yazi"; # function
# nxfiglet = "figlet";
};
interactiveShellInit = ''
set -g fish_greeting
if not set -q IN_NIX_SHELL
nxfetch
end
${pkgs.starship}/bin/starship init fish | source
# ${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source
'';
};
}