nix/modules/apps/home/zsh/scripts/rebuild.sh

20 lines
384 B
Bash
Raw Normal View History

2024-08-31 16:04:57 +02:00
#!/bin/sh
2024-08-31 16:55:57 +02:00
current_dir=$(pwd)
cd ~/nix
2024-08-31 16:04:57 +02:00
git add .
2024-08-31 16:55:57 +02:00
hostname=$(hostname)
if echo "$hostname" | grep -q 'desktop'; then
2024-08-31 16:04:57 +02:00
sudo nixos-rebuild switch --flake ~/nix/#desktop
2024-08-31 16:55:57 +02:00
elif echo "$hostname" | grep -q 'laptop'; then
2024-08-31 16:04:57 +02:00
sudo nixos-rebuild switch --flake ~/nix/#laptop
2024-10-05 02:26:34 +02:00
elif echo "$hostname" | grep -q 'localhost'; then
nix-on-droid switch --flake ~/nix
2024-08-31 16:04:57 +02:00
fi
2024-08-31 16:55:57 +02:00
cd "$current_dir"