dotfiles.nix/hm-configs/fish.nix

48 lines
1.5 KiB
Nix

{ pkgs, ... }: {
enable = true;
package = pkgs.fish;
interactiveShellInit = ''
alias clip="xclip -selection c"
alias cxuse="sudo cachix use -d ~/dotfiles.nix"
alias cxpsh="nix-shell --command exit; nix-store -qR --include-outputs (nix-instantiate shell.nix) | cachix push"
alias cxpush=cxpsh
alias code=codium
alias config="code ~/dotfiles.nix"
alias home="vim ~/dotfiles.nix/users/mat-hm.nix +'cd %:p:h'"
alias vims="vim -S Session.vim"
alias bigscreen="xrandr --output eDP1 --off --output HDMI2 --auto"
alias smallscreen="xrandr --output eDP1 --auto --output HDMI2 --off"
function tmux-ssh -a user -a host -a no_local
if test -z "$no_local"
set host "$host.local"
end
set target "$user@$host"
set session_host (string replace . - "$host" --all)
set session "$user-$session_host"
env TERM=tmux-256color ssh $target -t "tmux -2 attach -t $session || tmux -2 new -s $session"
end
alias pi="tmux-ssh pi pi y"
alias yuri="tmux-ssh root gagarin"
alias tmssh="tmux-ssh mat"
alias soviet="tmssh soviet y"
alias wifi="nmcli r w off; nmcli r w on"
alias nixops=~/dev/nixops/result/bin/nixops
alias sys="sudo systemctl"
alias rebuild="sudo nixos-rebuild switch"
alias rebuildd="sudo nixos-rebuild switch; and systemctl restart display-manager"
alias upgrade="sudo rm -rf /root/.cache/nix/tarballs; and sudo nix-channel --update; and sudo nixos-rebuild switch --upgrade"
kitty + complete setup fish | source
'';
}