FROM docker.io/archlinux/archlinux:latest

####
# Init

# Initialize pacman keyring
RUN pacman-key --init

# Update pacman sync databases
RUN pacman -Sy --noconfirm

# Update archlinux-keyring first
RUN pacman -S --needed --noconfirm archlinux-keyring

# Update packages
RUN pacman -Su --noconfirm


####
# Package Install

# Installing top-level packages
RUN pacman -S --noconfirm \
	weechat \
	tmux \
	mosh \
	zerotier-one \

# Installing optional deps
RUN pacman -S --needed --asdeps --noconfirm \
	aspell-en \
	lua \
	pearl \
	python \
	ruby \
	tcl \


####
# Setup

# Create user
RUN useradd -m -s /bin/bash thurstylark

# Configure sshd
ADD sshd_config /etc/ssh/

# Configure tmux
ADD tmux.conf /home/thurstylark/.tmux.conf

# zerotier-one identity and config
VOLUME /var/lib/zerotier-one/

# weechat config
VOLUME /home/thurstylark/.config/weechat/

# Startup script
ADD startup.bash /usr/bin/startup.bash

# Execute startup
CMD ["/usr/bin/bash", "/usr/bin/startup.bash"]