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

18 lines
296 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
fi
2024-08-31 16:55:57 +02:00
cd "$current_dir"