dot

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

25 lines850 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, which NixOS mounts read-only at /mnt/backup:
5#
6# /mnt/backup/vizie/git/dot/tools/restore-from-sata
7set -euo pipefail
8
9user=vizie
10repo=$(dirname "$(dirname "$(readlink -f "$0")")")
11backup=$(dirname "$(dirname "$repo")")
12
13if [ "$EUID" -ne 0 ]; then
14 echo "Run it as root." >&2
15 exit 1
16fi
17if [ ! -d "$backup/.ssh" ] || [ ! -f "$repo/restore-filter" ]; then
18 echo "$backup doesn't look like the home folder backup." >&2
19 exit 1
20fi
21
22# Owned by you (uid 1000) and the users group (100), as NixOS sets them up.
23rsync -aHAX --info=progress2 --chown=1000:100 \
24 --filter="merge $repo/restore-filter" "$backup/" "/home/$user/"
25echo "== Done. Log in on the desktop."