#!/bin/bash echo "##### build/run.sh" set -x TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)" cd "$TD" apt install -y $(cat packages.txt) SSH_HOST_KEY_FILES=" ssh_host_ecdsa_key ssh_host_ecdsa_key.pub ssh_host_ed25519_key ssh_host_ed25519_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub " locale-gen en_US.UTF-8 for FN in $SSH_HOST_KEY_FILES ; do ln -s /hostroot/etc/ssh/$FN /etc/ssh/$FN done ln -s /hostroot/root /root/.home # install other stuff here pip3 install -U pip pip3 install black # install python packages # install yarn # install prettier # install vim-go mkdir -p /home/user/.ssh cp /root/.ssh/authorized_keys /home/user/.ssh/authorized_keys echo chown -Rv $UID_TO_ADD:$GID_TO_ADD /home/user chown -Rv $UID_TO_ADD:$GID_TO_ADD /home/user chsh --shell $(which zsh) $USERNAME_TO_ADD echo "$USERNAME_TO_ADD ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user sudo \ --set-home \ --non-interactive \ -u $USERNAME_TO_ADD \ bash ./user.sh