Recent nix stuff
This commit is contained in:
parent
999d1693d1
commit
99d4a8591f
2 changed files with 35 additions and 5 deletions
|
|
@ -49,7 +49,7 @@ preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
|||
# The rice repo
|
||||
alias config='git --git-dir $HOME/repos/dotfiles/ --work-tree=$HOME'
|
||||
|
||||
alias sudo='sudo ' # Allow aliases to be passed to sudo
|
||||
alias s='sudo ' # Allow aliases to be passed to sudo
|
||||
alias pypr='sh -c pypr'
|
||||
alias asciiquarium='asciiquarium -t'
|
||||
alias ll='ls -l'
|
||||
|
|
@ -66,9 +66,6 @@ alias tor='torbrowser-launcher'
|
|||
alias emax="devour emacsclient -c -a 'emacs' 1>/dev/null"
|
||||
alias em="emacsclient -nw -a 'emacs -nw'"
|
||||
|
||||
# Print out all colors
|
||||
alias colors='for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$"\n"}; done'
|
||||
|
||||
# Colorful output
|
||||
alias ls='LC_COLLATE=C ls --color=auto --group-directories-first -hN -A'
|
||||
alias grep='grep --color=auto'
|
||||
|
|
@ -87,6 +84,12 @@ alias uptime='grc uptime'
|
|||
|
||||
## FUNCTIONS ##
|
||||
|
||||
function colors {
|
||||
for i in {0..255}; do
|
||||
print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$"\n"};
|
||||
done
|
||||
}
|
||||
|
||||
function lfcd {
|
||||
tmp="$(mktemp)"
|
||||
command lf -last-dir-path="$tmp" "$@"
|
||||
|
|
@ -101,6 +104,18 @@ function lfcd {
|
|||
fi
|
||||
}
|
||||
|
||||
function nix-clean {
|
||||
nix-env --delete-generations old
|
||||
nix-store --gc
|
||||
nix-channel --update
|
||||
nix-env -u --always
|
||||
for link in /nix/var/nix/gcroots/auto/*
|
||||
do
|
||||
rm $(readlink "$link")
|
||||
done
|
||||
nix-collect-garbage -d
|
||||
}
|
||||
|
||||
# This script was automatically generated by the broot program
|
||||
# More information can be found in https://github.com/Canop/broot
|
||||
# This function starts broot and executes the command
|
||||
|
|
@ -131,6 +146,10 @@ function nix_shell_menu {
|
|||
"
|
||||
}
|
||||
|
||||
function nixstore () {
|
||||
cd "$(dirname $(readlink -f $(which "$1")))"
|
||||
}
|
||||
|
||||
# function man () {
|
||||
# emacsclient -nw --eval '(progn (man "'$1'"))'
|
||||
# }
|
||||
|
|
@ -177,7 +196,7 @@ if [ ! -z "$(grep nixos /etc/os-release)" ]; then
|
|||
nix-shell "$@"
|
||||
fi
|
||||
}
|
||||
alias nix-shell='nix-shell-name'
|
||||
alias nix-shell=nix-shell-name
|
||||
else
|
||||
source ~/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
|
||||
fi
|
||||
|
|
@ -188,5 +207,8 @@ if [ -f ~/.config/zsh/.zshpersonalrc ]; then
|
|||
source ~/.config/zsh/.zshpersonalrc
|
||||
fi
|
||||
|
||||
accent_color="$(cat $HOME/.config/colors/accent)"
|
||||
starship config format "'''[╭──\([\$username@\$hostname](bold $accent_color)\)-\[\$directory\](-\[\$git_branch\$git_metrics\$git_status\])(-\[\$nix_shell\])]($accent_color) \$cmd_duration
|
||||
[╰─]($accent_color)[\$shell](bold $accent_color) '''"
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue