From 113e7c4683702344366cdd0e9204bac2eedd5d13 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Tue, 14 May 2024 21:19:12 -0400 Subject: [PATCH] added rollback justfile --- justfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/justfile b/justfile index 6f67c03..257aaf0 100644 --- a/justfile +++ b/justfile @@ -180,6 +180,14 @@ switch: @echo -e "\033[32m->> Switching to next generation ->>\033[0m" @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 boot: @echo -e "\033[34m->> Reboot to new generation ->>\033[0m"