nixos-config/quick-switch.sh

15 lines
335 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if [ -z "$(git status --porcelain)" ]
then
git push --force-with-lease
rev=$(git rev-parse HEAD)
sudo nixos-rebuild switch \
--flake "git+https://git.atauno.com/atau/nixos-config.git?ref=main&rev=$rev"
else
echo "Git working directory is unclean, please commit changes"
exit 1
fi