Files
system-config/system/hosts/mcp/pull-and-switch.sh
2025-03-02 14:35:06 -08:00

17 lines
320 B
Bash
Executable File

#!/usr/bin/env bash
# Fail on errors
set -e
# Validate the sudo access
sudo -v
# Switch to the Nixos configuration directory
cd /etc/nixos
# Pull the latest changes from the remote repository
sudo git fetch origin main
sudo git reset --hard origin/main
# Switch to the latest configuration
sudo nixos-rebuild switch