# PRE COMMANDS
d-i preseed/early_command string kill-all-dhcp; netcfg

# LOCALE AND KEYBOARD
d-i debian-installer/locale string en_AU
d-i keyboard-configuration/xkb-keymap select us

# NETWORK AND HOSTNAME
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string vrepo
d-i netcfg/get_domain string local
d-i netcfg/hostname string vrepo
d-i netcfg/wireless_wep string

# MIRROR
d-i mirror/country string manual
d-i mirror/http/hostname string mirror.aarnet.edu.au
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

# ACCOUNTS
d-i passwd/root-login boolean false
d-i passwd/user-fullname string Cybersecure
d-i passwd/username string cybersecure
d-i passwd/user-password password cybersecure
d-i passwd/user-password-again password cybersecure

# CLOCK AND NTP
d-i clock-setup/utc boolean true
d-i time/zone string Australia/Victoria
d-i clock-setup/ntp boolean true

# DISK AND PARTITIONING
d-i partman-efi/non_efi_system boolean false
d-i partman-partitioning/choose_label select gpt
d-i partman-partitioning/default_label string gpt
d-i partman/default_filesystem string xfs
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/disk string /dev/nvme0n1
d-i partman-auto/expert_recipe string \
    gpt-xfs :: \
        1024 1024 1024 fat32 \
            $iflabel{ gpt } \
            $reusemethod{ } \
            method{ efi } \
            format{ } \
    . \
        4096 4096 4096 linux-swap \
            method{ swap } format{ } \
    . \
        512 100000000000 100000000000 xfs \
            method{ format } format{ } \
            use_filesystem{ } filesystem{ xfs } \
            mountpoint{ / } \
    . \
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

# APT SETUP
d-i apt-setup/cdrom/set-first boolean false

# INCLUDED SOFTRWARE
tasksel tasksel/first multiselect standard ssh-server

# GRUB BOOT
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean false
d-i grub-installer/force-efi-extra-removable boolean true


#FINAL
d-i preseed/late_command string in-target --pass-stdout echo -e "LABEL=repo1 /repo1 xfs discard 0 2" >> /target/etc/fstab; mkdir /repo1; mkfs.xfs -f -L repo1 /dev/nvme1n1; rm /target/etc/systemd/system/timers.target.wants/fstrim.timer
d-i finish-install/reboot_in_progress note
