nix/home/zsh/desktop-laptop.sh
2024-08-05 21:03:25 +02:00

13 lines
280 B
Bash
Executable file

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