end of refactor for now

This commit is contained in:
2025-12-19 08:04:19 +03:00
parent aeb61e6690
commit 3e9e074cc5
12 changed files with 44 additions and 66 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/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..."
nix flake update "$DEST_FOLDER"
home-manager switch --flake ~/.config/home-manager
echo "Done! Backup (if any) stored at $BACKUP_DIR"