dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

26 lines862 bytesexecutable
1#!/usr/bin/env bash
2# Puts back what restore-filter lists from the backup drive into the new
3# system's home folder (MIGRATION.md, step 3). Run it as root from the backup
4# drive itself, mounted at /mnt:
5#
6# mount -o ro /dev/disk/by-label/backup /mnt
7# /mnt/vizie/git/dot/tools/restore-from-sata
8set -euo pipefail
9
10user=vizie
11repo=$(dirname "$(dirname "$(readlink -f "$0")")")
12backup=$(dirname "$(dirname "$repo")")
13
14if [ "$EUID" -ne 0 ]; then
15 echo "Run it as root." >&2
16 exit 1
17fi
18if [ ! -d "$backup/.ssh" ] || [ ! -f "$repo/restore-filter" ]; then
19 echo "$backup doesn't look like the home folder backup." >&2
20 exit 1
21fi
22
23# Owned by you (uid 1000) and the users group (100), as NixOS sets them up.
24rsync -aHAX --info=progress2 --chown=1000:100 \
25 --filter="merge $repo/restore-filter" "$backup/" "/home/$user/"
26echo "== Done. Log in on the desktop."