nix/modules/apps/cli/zsh/scripts/rebuild.sh
2024-09-15 10:25:38 +02:00

18 lines
296 B
Bash
Executable file

#!/bin/sh
current_dir=$(pwd)
cd ~/nix
git add .
hostname=$(hostname)
if echo "$hostname" | grep -q 'desktop'; then
sudo nixos-rebuild switch --flake ~/nix/#desktop
elif echo "$hostname" | grep -q 'laptop'; then
sudo nixos-rebuild switch --flake ~/nix/#laptop
fi
cd "$current_dir"