nix/home/zsh/rebuild.sh

12 lines
420 B
Bash
Raw Normal View History

2024-08-10 22:09:09 +02:00
#!/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)
2024-08-11 08:45:09 +02:00
rm nixos-switch.log
2024-08-10 22:09:09 +02:00
elif [[ $hostname == *"laptop"* ]]; then
sudo nixos-rebuild switch --flake ~/nix/#laptop &>nixos-switch.log || (cat nixos-switch.log | grep --color error && false)
2024-08-11 08:45:09 +02:00
rm nixos-switch.log
2024-08-10 22:09:09 +02:00
fi