home · contact · privacy
7dd2f8f690ee80019a65e7716d6b98458ca68349
[config] / buster / setup_scripts / setup_home_eeepc.sh
1 #!/bin/sh
2 set -e
3
4 public_repos_dir="${HOME}/public_repos"
5 config_tree_prefix="${public_repos_dir}/config/buster"
6 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
7 repos_list_file="${public_repos_dir}/repos"
8 dir_secrets="${HOME}/tmp_secrets"
9 borgkeys_dir=~/.config/borg/keys
10 ssh_dir=~/.ssh
11
12 ensure_repo() {
13     repo_name="${1}"
14     if [ ! -d "${public_repos_dir}/${repo_name}" ]; then
15         cd "${public_repos_dir}"
16         git clone https://plomlompom.com/repos/clone/${repo_name}
17     fi
18 }
19
20 cd
21 mkdir -p "${public_repos_dir}"
22 ensure_repo config
23 cd "${setup_scripts_dir}"
24 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "${HOME}" minimal user_eeepc
25 curl -fsSl https://raw.githubusercontent.com/tridactyl/tridactyl/78e662efefd1f4af2bdb2a53edecf03b535b997b/native/install.sh | bash
26 cd "${dir_secrets}"
27 mkdir -p "${ssh_dir}"
28 echo "Setting up .ssh"
29 cp id_rsa ~/.ssh
30 stty -echo
31 ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
32 stty echo
33 tar xf borg_keyfiles.tar
34 mkdir -p "${borgkeys_dir}"
35 mv borg_keyfiles/* "${borgkeys_dir}"
36 cd
37 rm -rf "${dir_secrets}"
38 cat "${repos_list_file}" | while read line; do
39     ensure_repo "${line}"
40 done
41 echo "TODO: As tridactyl user, don't forget to do :source on the first Firefox run and then re-start."