From 9c909ba079e048ffab455ddb1c41d411f28791d5 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 16 Oct 2025 10:30:05 -0300 Subject: [PATCH] hm-cli now backups files before applying --- packages/hm-cli.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hm-cli.nix b/packages/hm-cli.nix index 614f287..f6034ea 100644 --- a/packages/hm-cli.nix +++ b/packages/hm-cli.nix @@ -36,7 +36,7 @@ pkgs.writeShellScriptBin "hm" '' case "$1" in apply) - "$HM" switch --flake "$FLAKE_PATH#$FLAKE_OUTPUT" + "$HM" switch --flake "$FLAKE_PATH#$FLAKE_OUTPUT" -b bkp ;; generation) if [[ $# -lt 2 ]]; then @@ -65,14 +65,14 @@ pkgs.writeShellScriptBin "hm" '' echo "Error: could not determine previous generation (possibly only one generation exists)" exit 1 fi - "$HM" switch --flake "$FLAKE_PATH" --switch-generation "$PREV_GEN" + "$HM" switch --flake "$FLAKE_PATH" --switch-generation "$PREV_GEN" -b bkp ;; switch) if [[ $# -ne 3 ]]; then echo "Error: switch requires exactly one generation ID" exit 1 fi - "$HM" switch --flake "$FLAKE_PATH" --switch-generation "$3" + "$HM" switch --flake "$FLAKE_PATH" --switch-generation "$3" -b bkp ;; cleanup) CURRENT_GEN=$("$HM" generations | sed -n 's/^.*id \([0-9]\+\) .* (current)$/\1/p')