work/root.sh

62 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2020-04-11 17:53:41 +00:00
#!/bin/bash
2020-05-26 07:07:46 +00:00
echo "##### build/root.sh"
2020-04-11 19:18:22 +00:00
2020-04-11 23:41:22 +00:00
export LANG="en_US.UTF-8"
export LANGUAGE="en_US:en"
2020-04-11 19:18:22 +00:00
set -x
2020-05-16 11:28:48 +00:00
set -e
2020-04-11 19:18:22 +00:00
2020-04-11 17:53:41 +00:00
TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
cd "$TD"
2020-04-11 18:55:50 +00:00
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
"
2020-04-11 23:41:22 +00:00
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
2020-04-11 23:11:49 +00:00
locale-gen en_US.UTF-8
2020-05-16 11:28:48 +00:00
update-locale LANG="en_US.UTF-8" LANGUAGE="en_US"
2020-04-11 23:41:22 +00:00
dpkg-reconfigure locales
2020-04-11 23:11:49 +00:00
2020-04-11 18:55:50 +00:00
for FN in $SSH_HOST_KEY_FILES ; do
2021-10-14 09:04:14 +00:00
rm -f /etc/ssh/$FN
2020-04-11 18:55:50 +00:00
ln -s /hostroot/etc/ssh/$FN /etc/ssh/$FN
done
2021-10-14 09:04:14 +00:00
#ln -s /hostroot/root /root/.home
2020-04-11 19:18:22 +00:00
2020-04-11 18:55:50 +00:00
# install other stuff here
2020-05-26 07:07:46 +00:00
# FIXME do these with nix:
#pip3 install -U pip
#pip3 install black
2020-04-11 18:55:50 +00:00
# install python packages
# install yarn
# install prettier
# install vim-go
2021-10-14 09:04:14 +00:00
# i don't know how to make the terraform-libvirt provider
# build with nix's libvirt, this works for now
apt update && apt install -y libvirt0
2020-04-11 23:11:49 +00:00
mkdir -p /home/user/.ssh
cp /root/.ssh/authorized_keys /home/user/.ssh/authorized_keys
2021-10-14 09:04:14 +00:00
chown -R user:user /home/user
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user
2020-07-08 07:26:10 +00:00
2021-10-14 09:04:14 +00:00
groupadd -g 131 docker
usermod -aG docker user
2020-07-08 07:26:10 +00:00
2021-10-14 09:04:14 +00:00
#mkdir -p /etc/nix
#echo 'sandbox = false' > /etc/nix/nix.conf
#chown -R user:user /nix /etc/nix