stable version. add scripts for fast update
This commit is contained in:
Executable
+23
@@ -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"
|
||||
Reference in New Issue
Block a user