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

24 lines
496 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-10-08 15:28:40 +02:00
alejandra .
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-09 11:14:10 +02:00
elif echo "$hostname" | grep -q 'server'; then
2024-10-08 22:43:41 +02:00
sudo nixos-rebuild switch --flake ~/nix/#server
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"