better rb.sh
This commit is contained in:
parent
e7854d8f9a
commit
9518f12e34
|
@ -13,11 +13,11 @@
|
||||||
cat = "bat";
|
cat = "bat";
|
||||||
cn = "cd ~/nix";
|
cn = "cd ~/nix";
|
||||||
ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first";
|
ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first";
|
||||||
pu = "sh ~/nix/modules/zsh/scripts/push.sh";
|
pu = "sh ~/nix/modules/apps/zsh/scripts/push.sh";
|
||||||
ip = "sh ~/nix/modules/zsh/scripts/ip.sh";
|
ip = "sh ~/nix/modules/apps/zsh/scripts/ip.sh";
|
||||||
fr = "sudo systemctl reboot --firmware";
|
fr = "sudo systemctl reboot --firmware";
|
||||||
ser = "ssh root@joygnu.org";
|
ser = "ssh root@joygnu.org";
|
||||||
rb = "sh ~/nix/modules/zsh/scripts/rebuild.sh";
|
rb = "sh ~/nix/modules/apps/zsh/scripts/rebuild.sh";
|
||||||
up = "sudo nix flake update ~/nix";
|
up = "sudo nix flake update ~/nix";
|
||||||
del = "sudo nix-collect-garbage -d";
|
del = "sudo nix-collect-garbage -d";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
hostname=$(hostname)
|
current_dir=$(pwd)
|
||||||
|
|
||||||
|
cd ~/nix
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
if [[ $hostname == *"desktop"* ]]; then
|
hostname=$(hostname)
|
||||||
|
|
||||||
|
if echo "$hostname" | grep -q 'desktop'; then
|
||||||
sudo nixos-rebuild switch --flake ~/nix/#desktop
|
sudo nixos-rebuild switch --flake ~/nix/#desktop
|
||||||
elif [[ $hostname == *"laptop"* ]]; then
|
elif echo "$hostname" | grep -q 'laptop'; then
|
||||||
sudo nixos-rebuild switch --flake ~/nix/#laptop
|
sudo nixos-rebuild switch --flake ~/nix/#laptop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cd "$current_dir"
|
||||||
|
|
Loading…
Reference in a new issue