nix/home/zsh/pc-laptop.sh

15 lines
378 B
Bash
Raw Normal View History

2024-07-03 15:40:52 +02:00
#!/bin/bash
hostname=$(hostname)
if [[ $hostname == *"pc"* ]]; then
2024-07-03 15:53:12 +02:00
echo "This machine is identified as a Desktop PC."
2024-07-03 15:40:52 +02:00
sudo nixos-rebuild switch --flake ~/nix/#pc
elif [[ $hostname == *"laptop"* ]]; then
2024-07-03 15:53:12 +02:00
echo "This machine is identified as a Laptop."
2024-07-03 15:40:52 +02:00
sudo nixos-rebuild switch --flake ~/nix/#laptop
else
echo "Unable to determine the type of machine."
fi