2021-12-25 17:32:14 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
REPO_ROOT="${SCRIPT_DIR}/.."
|
|
|
|
cd $REPO_ROOT
|
|
|
|
|
|
|
|
# re-run as root
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
|
|
sudo ${BASH_SOURCE[0]} $@
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-09-20 19:05:44 +01:00
|
|
|
MODE=${1-}
|
|
|
|
if [ -z "${MODE}" ]; then
|
|
|
|
MODE=switch
|
|
|
|
else
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2022-09-19 12:34:23 +01:00
|
|
|
sudo cpupower frequency-set -g performance
|
2024-03-10 21:00:43 +00:00
|
|
|
nixos-rebuild --fast --flake "${REPO_ROOT}#$(hostname)" "$MODE" "$@"
|