summaryrefslogtreecommitdiff
path: root/lxc/roll
blob: f2e6cf529874a2dbe9164e4b73f760c5658d430e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#set -e

NAME=$1
lxc-create -n $NAME -t download -- --dist archlinux --release current --arch amd64
lxc-start  -n $NAME
sleep 10
lxc-attach -n $NAME -- pacman -Syu --noconfirm
lxc-attach -n $NAME -- pacman -Sy --noconfirm \
	go git sudo fakeroot binutils make gcc patch vim openssh xorg-xauth xorg-xhost
lxc-attach -n $NAME -- useradd tom
lxc-attach -n $NAME -- mkdir /home/tom
lxc-attach -n $NAME -- mkdir /home/tom/yay
lxc-attach -n $NAME -- git clone https://aur.archlinux.org/yay.git /home/tom/yay
lxc-attach -n $NAME -- chown tom:tom -R /home/tom
lxc-attach -n $NAME -- bash -c 'echo "tom ALL=(ALL) ALL" >> /etc/sudoers'
lxc-attach -n $NAME -- bash -c 'echo -e "tom\ntom" | passwd tom'
lxc-attach -n $NAME -- bash -c 'cd /home/tom/yay && sudo -S -u tom makepkg -si --noconfirm'
lxc-attach -n $NAME -- bash -c 'sudo -S -u tom yay -Syu --noconfirm'
lxc-attach -n $NAME -- bash -c 'echo "X11Forwarding yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- systemctl start sshd
lxc-attach -n $NAME -- ip a