nix/home/zsh/pc-laptop.sh
2024-07-03 15:40:52 +02:00

13 lines
272 B
Bash
Executable file

#!/bin/bash
hostname=$(hostname)
if [[ $hostname == *"pc"* ]]; then
sudo nixos-rebuild switch --flake ~/nix/#pc
elif [[ $hostname == *"laptop"* ]]; then
sudo nixos-rebuild switch --flake ~/nix/#laptop
else
echo "Unable to determine the type of machine."
fi