#cloud-config
hostname: zepir
manage_etc_hosts: true

users:
  - name: pi
    groups: [sudo, audio, video, gpio, i2c, spi, input, netdev, plugdev]
    shell: /bin/bash
    lock_passwd: false
    plain_text_passwd: "zepir"
    sudo: ALL=(ALL) NOPASSWD:ALL

ssh_pwauth: true
enable_ssh: true

timezone: Europe/Bratislava
locale: en_GB.UTF-8

keyboard:
  model: pc105
  layout: "us"
  variant: "altgr-intl"

runcmd:
  # 1. Copy display firmware
  - [ cp, /boot/firmware/zepir/zepir-st7789.bin, /lib/firmware/ ]
  # 2. Console autologin
  - [ raspi-config, nonint, do_boot_behaviour, B2 ]
  # 3. Audio output to headphone jack
  - [ raspi-config, nonint, do_audio, "1" ]
  # 4. Console font: Terminus 6x12
  - [ sed, -i, 's/^FONTFACE=.*/FONTFACE="Terminus"/', /etc/default/console-setup ]
  - [ sed, -i, 's/^FONTSIZE=.*/FONTSIZE="6x12"/', /etc/default/console-setup ]

power_state:
  mode: reboot
  message: "First-boot configuration finished, rebooting"
  timeout: 30
  condition: true