My main Home Assistant configuration
sudo pacman -Syu --needed git python gcc sed grep autoconf automake make
sudo useradd -m -r -G uucp homeassistant
sudo -iu homeassistant
python -m venv venv
. venv/bin/activate
CFLAGS=-I/usr/lib/libffi-3.2.1/include pip install -U homeassistant
exit
sudo tee -a /etc/systemd/system/homeassistant.service > /dev/null <<EOF
[Unit]
Description=Home Assistant
[Service]
Type=simple
User=homeassistant
ExecStart=/home/homeassistant/venv/bin/hass -c "/home/homeassistant/.homeassistant"
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable --now homeassistant