added rollback justfile

This commit is contained in:
Bryan Ramos 2024-05-14 21:19:12 -04:00
parent 9e6d16da2a
commit 113e7c4683
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8

View file

@ -180,6 +180,14 @@ switch:
@echo -e "\033[32m->> Switching to next generation ->>\033[0m" @echo -e "\033[32m->> Switching to next generation ->>\033[0m"
@sudo nixos-rebuild switch --flake .#{{SYSTEM}} @sudo nixos-rebuild switch --flake .#{{SYSTEM}}
# Rollback to previous generation
rollback SYSTEM="nixos":
#!/usr/bin/env bash
set -euo pipefail
if [ {{SYSTEM}} = "nixos" ]; then
sudo nixos-rebuild switch --rollback
fi
# NixOS-rebuild boot for the current system # NixOS-rebuild boot for the current system
boot: boot:
@echo -e "\033[34m->> Reboot to new generation ->>\033[0m" @echo -e "\033[34m->> Reboot to new generation ->>\033[0m"