NOflake/users/tao/nushell/stuff.nu

70 lines
1.5 KiB
Text
Raw Normal View History

2024-03-15 12:47:44 -07:00
source ~/.cache/starship/init.nu
source ~/.zoxide.nu
2024-04-20 18:47:52 -07:00
2024-03-31 00:52:09 -07:00
def bump [] {
2024-04-28 10:20:53 -07:00
cd /home/tao/projects/NOflake/
jj new -m "bump"
nix flake update
2024-04-20 18:47:52 -07:00
# rc2nix | save -f /home/tao/projects/NOflake/users/tao/plasma.nix;
2024-04-28 10:20:53 -07:00
sudo nixos-rebuild boot --flake /home/tao/projects/NOflake/ --impure --verbose
}
2024-04-20 18:47:52 -07:00
2024-04-28 10:56:51 -07:00
def l [
path?
flags?
] {
2024-04-29 13:53:43 -07:00
if $path != null {
2024-04-28 10:56:51 -07:00
ls $path
2024-04-29 13:43:23 -07:00
} else {
ls
2024-04-28 10:56:51 -07:00
} | sort-by type name -i
}
2024-04-29 13:43:23 -07:00
def tse [exit_node?] {
2024-04-29 13:53:43 -07:00
if $exit_node != null {
2024-04-29 13:43:23 -07:00
tailscale set --exit-node $exit_node
} else {
tailscale set --exit-node=""
}
2024-04-20 18:47:52 -07:00
}
2024-05-06 12:58:30 -07:00
def tsr [] {
tailscale status --json | from json | get Peer | transpose nodekey node | get node | filter {$in.Location?.Country == USA} | get TailscaleIPs | each {get 0} | select (random int 0..($in | length)) | tse $in.0;
tailscale status
}
2024-04-28 10:56:51 -07:00
def rb [] {
sudo nice -n19 nixos-rebuild boot --flake . --impure --verbose
hx --grammar fetch; hx --grammar build
2024-05-06 12:58:30 -07:00
rm -rf ~/.cache/jdtls/
2024-04-28 10:56:51 -07:00
}
def rs [] {
2024-04-29 13:53:43 -07:00
sudo nice -n19 nixos-rebuild switch --flake . --impure --verbose
2024-04-28 10:56:51 -07:00
hx --grammar fetch; hx --grammar build
2024-05-06 12:58:30 -07:00
rm -rf ~/.cache/jdtls/
}
def ns [package] {
nix shell $"nixpkgs#($package)"
2024-04-28 10:56:51 -07:00
}
alias ard = arduino-cli
alias arduino-cli = boxxy arduino-cli
2024-03-22 15:15:33 -07:00
alias b = btm;
2024-03-15 12:47:44 -07:00
alias cringe = sudo bootctl set-oneshot auto-windows
2024-03-17 00:22:50 -07:00
alias fetch = neofetch
2024-03-15 12:47:44 -07:00
alias ff = firefox
2024-04-29 16:25:28 -07:00
alias gc = nh clean all
2024-03-15 14:41:13 -07:00
alias jd = jj diff
2024-04-28 10:56:51 -07:00
alias js = jj status
2024-03-15 12:47:44 -07:00
alias pu = pueue
alias t = task
alias ts = tailscale
alias tss = tailscale status
alias tsx = tailscale exit-node list
alias zl = zellij
2024-04-25 15:48:29 -07:00
2024-03-15 12:47:44 -07:00
task