3 debian_version="bookworm"
4 legal_system_names="x220 w530"
6 if [ "$#" -ne 1 ]; then
7 echo 'Need exactly one argument (system name).'
11 for system_name_i in $legal_system_names; do
12 if [ "$1" = "$system_name_i" ]; then
14 system_name="${system_name_i}"
18 if [ "$found" = 0 ]; then
19 echo "Need legal system name."
24 # config_tree_prefix="${public_repos_dir}/config/${debian_version}"
25 git clone https://plomlompom.com/repos/clone/config
26 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "${HOME}" minimal user "${system_name}"
28 # public_repos_dir="${HOME}/public_repos"
29 # config_tree_prefix="${public_repos_dir}/config/${debian_version}"
30 # # path_borgscript="${config_tree_prefix}//borg.sh"
31 # setup_scripts_dir="${config_tree_prefix}/setup_scripts"
32 # repos_list_file="${public_repos_dir}/repos"
33 # # dir_secrets="${HOME}/tmp_secrets"
34 # # borgkeys_dir=~/.config/borg/keys
35 # # borgrepos_file=~/.borgrepos
37 # # authinfo_file=.authinfo
38 # maildir=~/mail/maildir
42 # if [ ! -d "${public_repos_dir}/${repo_name}" ]; then
43 # cd "${public_repos_dir}"
44 # git clone plom@plomlompom.com:/var/repos/${repo_name}
48 # # Set up iniitial non-public parts of infrastructure: SSH authentication.
50 # mkdir -p "${ssh_dir}"
51 # echo "Setting up .ssh"
54 # ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
58 # ssh-keyscan -H "plomlompom.com" >> ~/.ssh/known_hosts
60 # # Clone config to copy dotfiles etc. from it.
62 # mkdir -p "${public_repos_dir}"
64 # cd "${setup_scripts_dir}"
65 # ./copy_dirtree.sh "${config_tree_prefix}/home_files" "${HOME}" minimal user "${system_name}"
67 # # Set up native messenger for tridactyl.
68 # version='ef9f02d0da258f68d7faf8898707f6d83d90d07a'
69 # curl -fsSl "https://raw.githubusercontent.com/tridactyl/tridactyl/${version}/native/install.sh" | bash
71 # # Set up further non-public parts of infrastructure.
73 # script -c 'gpg --import secret_keys.asc' /dev/null
74 # tar xf borg_keyfiles.tar
75 # mkdir -p "${borgkeys_dir}"
76 # mv borg_keyfiles/* "${borgkeys_dir}"
77 # # .authinfo may not be present on every secrets drive yet
78 # if [ -f "${authinfo_file}" ]; then
79 # cp "${authinfo_file}" ~
82 # rm -rf "${dir_secrets}"
84 # # Sync org dir via borgbackup. For this we need the borgbackup servers
85 # # in our .ssh/known_hosts file.
86 # cat "${borgrepos_file}" | while read line; do
87 # first_char=$(echo "${line}" | cut -c1)
88 # if [ "${first_char}" = "#" ]; then
91 # server=$(echo "${line}" | sed 's/.*@//')
92 # ssh-keyscan "${server}" >> "${ssh_dir}"/known_hosts
94 # BORG_PASSPHRASE="${SECRETS_PASS}" "${path_borgscript}" orgpull
96 # # Fill ~/public_repos.
97 # cat "${repos_list_file}" | while read line; do
98 # first_char=$(echo "${line}" | cut -c1)
99 # if [ "${first_char}" = "#" ]; then
102 # ensure_repo "${line}"
105 # # Set up e-mail system. Note that we only do mbsync if the imap pass file
106 # # is found. It may not be present on every secrets drive yet, so we have to
107 # # deal with the possibility of it being absent at this point.
108 # mkdir -p "${maildir}" # expected by mbsync/isync
109 # if [ -f "${HOME}/${authinfo_file}" ]; then
114 # # # Final note on how to integrate tridactyl.
115 # # echo "TODO: As tridactyl user, don't forget to do :source on the first Firefox run, wait a little while (Tridactyl needs to walk through all commands in the .tridactylrc) and then re-start."