stable version. add scripts for fast update

This commit is contained in:
2025-11-14 04:22:12 +03:00
parent 2ec91a2043
commit d6dc169e1c
7 changed files with 115 additions and 35 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
# ---------------- CONFIG ----------------
SRC_FOLDER="./home-manager" # source folder in your repo
DEST_FOLDER="$HOME/.config/home-manager" # target folder
# ----------------------------------------
# Create backup if destination exists
if [ -d "$DEST_FOLDER" ]; then
BACKUP_DIR="$DEST_FOLDER.bak.$(date +%Y%m%d%H%M%S)"
echo "Creating backup of existing configuration at $BACKUP_DIR..."
cp -r "$DEST_FOLDER" "$BACKUP_DIR"
fi
echo "Copying Home Manager configuration from '$SRC_FOLDER' to '$DEST_FOLDER'..."
mkdir -p "$DEST_FOLDER"
cp -a "$SRC_FOLDER/." "$DEST_FOLDER/"
echo "Running home-manager switch..."
home-manager switch
echo "Done! Backup (if any) stored at $BACKUP_DIR"