nix/home/zsh/rebuild.sh
2024-08-10 22:09:09 +02:00

10 lines
372 B
Bash
Executable file

#!/bin/sh
hostname=$(hostname)
if [[ $hostname == *"desktop"* ]]; then
sudo nixos-rebuild switch --flake ~/nix/#desktop &>nixos-switch.log || (cat nixos-switch.log | grep --color error && false)
elif [[ $hostname == *"laptop"* ]]; then
sudo nixos-rebuild switch --flake ~/nix/#laptop &>nixos-switch.log || (cat nixos-switch.log | grep --color error && false)
fi