3 debian_version="bookworm"
6 expect_n_args 1 "(system name)" "$@"
7 get_system_name_arg "$1"
9 git clone https://plomlompom.com/repos/clone/config
11 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "${HOME}" minimal user "${system_name}"
13 # public_repos_dir="${HOME}/public_repos"
14 # config_tree_prefix="${public_repos_dir}/config/${debian_version}"
15 # # path_borgscript="${config_tree_prefix}//borg.sh"
16 # setup_scripts_dir="${config_tree_prefix}/setup_scripts"
17 # repos_list_file="${public_repos_dir}/repos"
18 # # dir_secrets="${HOME}/tmp_secrets"
19 # # borgkeys_dir=~/.config/borg/keys
20 # # borgrepos_file=~/.borgrepos
22 # # authinfo_file=.authinfo
23 # maildir=~/mail/maildir
27 # if [ ! -d "${public_repos_dir}/${repo_name}" ]; then
28 # cd "${public_repos_dir}"
29 # git clone plom@plomlompom.com:/var/repos/${repo_name}
33 # # Set up iniitial non-public parts of infrastructure: SSH authentication.
35 # mkdir -p "${ssh_dir}"
36 # echo "Setting up .ssh"
39 # ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
43 # ssh-keyscan -H "plomlompom.com" >> ~/.ssh/known_hosts
45 # # Clone config to copy dotfiles etc. from it.
47 # mkdir -p "${public_repos_dir}"
49 # cd "${setup_scripts_dir}"
50 # ./copy_dirtree.sh "${config_tree_prefix}/home_files" "${HOME}" minimal user "${system_name}"
52 # # Set up native messenger for tridactyl.
53 # version='ef9f02d0da258f68d7faf8898707f6d83d90d07a'
54 # curl -fsSl "https://raw.githubusercontent.com/tridactyl/tridactyl/${version}/native/install.sh" | bash
56 # # Set up further non-public parts of infrastructure.
58 # script -c 'gpg --import secret_keys.asc' /dev/null
59 # tar xf borg_keyfiles.tar
60 # mkdir -p "${borgkeys_dir}"
61 # mv borg_keyfiles/* "${borgkeys_dir}"
62 # # .authinfo may not be present on every secrets drive yet
63 # if [ -f "${authinfo_file}" ]; then
64 # cp "${authinfo_file}" ~
67 # rm -rf "${dir_secrets}"
69 # # Sync org dir via borgbackup. For this we need the borgbackup servers
70 # # in our .ssh/known_hosts file.
71 # cat "${borgrepos_file}" | while read line; do
72 # first_char=$(echo "${line}" | cut -c1)
73 # if [ "${first_char}" = "#" ]; then
76 # server=$(echo "${line}" | sed 's/.*@//')
77 # ssh-keyscan "${server}" >> "${ssh_dir}"/known_hosts
79 # BORG_PASSPHRASE="${SECRETS_PASS}" "${path_borgscript}" orgpull
81 # # Fill ~/public_repos.
82 # cat "${repos_list_file}" | while read line; do
83 # first_char=$(echo "${line}" | cut -c1)
84 # if [ "${first_char}" = "#" ]; then
87 # ensure_repo "${line}"
90 # # Set up e-mail system. Note that we only do mbsync if the imap pass file
91 # # is found. It may not be present on every secrets drive yet, so we have to
92 # # deal with the possibility of it being absent at this point.
93 # mkdir -p "${maildir}" # expected by mbsync/isync
94 # if [ -f "${HOME}/${authinfo_file}" ]; then
99 # # # Final note on how to integrate tridactyl.
100 # # 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."