feat: Steamify's default setup for the new user during the install (Calamares step before cleanup)

This commit is contained in:
theupriser committed 2026-09-27 19:29:04 +02:00
1 parent 4937780541
commit 331c799ea7
6 files changed
+175

No files matched your search

+1
View File
@@ -21,3 +21,4 @@ archiso/airootfs/etc/environment
archiso/airootfs/etc/pacman.d/cachyos-mirrorlist
archiso/airootfs/etc/edition-tag
archiso/airootfs/etc/version-tag
archiso/airootfs/usr/local/share/steamify/
@@ -0,0 +1,10 @@
# Steamify: the Steam Machine setup for the new user, before the first boot.
---
dontChroot: true
timeout: 3600
script:
- "-/usr/local/bin/steamify-install ${ROOT} ${USER}"
i18n:
name: "Setting up the Steam Machine (Steamify)"
@@ -0,0 +1,127 @@
# SPDX-FileCopyrightText: no
# SPDX-License-Identifier: CC0-1.0
#
# Configuration file for Calamares
---
modules-search: [ local ]
instances:
- id: online
module: packages
config: packages_online.conf
- id: online
module: welcome
config: welcome_online.conf
- id: before-online
module: shellprocess
config: shellprocess-before-online.conf
- id: modify_mk_hook
module: shellprocess
config: shellprocess_modify_mk_hook.conf
- id: reset_mk_hook
module: shellprocess
config: shellprocess_reset_mk_hook.conf
- id: initialize_pacman
module: shellprocess
config: shellprocess_initialize_pacman.conf
- id: bootloader
module: packagechooser
config: packagechooser_bootloader.conf
- id: desktop
module: packagechooser
config: packagechooser_desktop.conf
- id: enable_ufw
module: shellprocess
config: shellprocess_enable_ufw.conf
- id: greetd
module: shellprocess
config: shellprocess_greetd.conf
- id: btrfs_snapshot
module: shellprocess
config: shellprocess_btrfs_snapshot.conf
- id: steamify
module: shellprocess
config: shellprocess_steamify.conf
- id: cleanup_calamares
module: shellprocess
config: shellprocess_cleanup_calamares.conf
sequence:
- show:
- welcome@online
- locale
- keyboard
- packagechooser@bootloader
- partition
- packagechooser@desktop
- netinstall
- users
- summary
- exec:
- partition
- zfs
- mount
- shellprocess@modify_mk_hook
- shellprocess@initialize_pacman
- shellprocess@before-online
- pacstrap
- machineid
- users
- locale
- keyboard
- localecfg
- chwd
- packages@online
- luksbootkeyfile
- luksopenswaphookcfg
- fstab
- plymouthcfg
- zfshostid
- initcpiocfg
- initcpio
- networkcfg
- displaymanager
- hwclock
- grubcfg
- bootloader
- shellprocess@reset_mk_hook
- services-systemd
- shellprocess
- shellprocess@enable_ufw
- shellprocess@greetd
- shellprocess@btrfs_snapshot
- shellprocess@steamify
- shellprocess@cleanup_calamares
- umount
- show:
- finished
branding: cachyos
prompt-install: true
dont-chroot: false
oem-setup: false
disable-cancel: false
disable-cancel-during-exec: false
hide-back-and-next-during-exec: true
quit-at-end: false
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# steamify-install <target root> <user>: runs Steamify's default setup for
# the new user inside the installed system (Calamares, after the users and
# services steps). Steamify refuses root and asks sudo per command, so the
# user gets a NOPASSWD rule for this run only. Never fails the install: a
# problem leaves the log and Steamify can be run again from the desktop.
root="$1" user="$2"
log="$root/var/log/steamify-install.log"
rule="$root/etc/sudoers.d/00-steamify-install"
[[ -d "$root" && -n "$user" ]] || exit 0
install -Dm755 /usr/local/share/steamify/steamify.sh "$root/var/tmp/steamify.sh"
printf '%s ALL=(ALL) NOPASSWD: ALL\n' "$user" > "$rule"
chmod 440 "$rule"
arch-chroot "$root" runuser -u "$user" -- env -i HOME="/home/$user" USER="$user" LOGNAME="$user" \
PATH=/usr/local/bin:/usr/bin TERM=dumb LANG=C.UTF-8 \
bash -c 'cd ~ && bash /var/tmp/steamify.sh --defaults < /dev/null' > "$log" 2>&1
echo "exit: $?" >> "$log"
rm -f "$rule" "$root/var/tmp/steamify.sh"
exit 0
+1
View File
@@ -27,6 +27,7 @@ file_permissions=(
["/root/.gnupg"]="0:0:700"
["/usr/local/bin/choose-mirror"]="0:0:755"
["/usr/local/bin/dmcheck"]="0:0:755"
["/usr/local/bin/steamify-install"]="0:0:755"
["/usr/local/bin/calamares-online.sh"]="0:0:755"
["/usr/local/bin/remove-nvidia"]="0:0:755"
["/usr/local/bin/removeun"]="0:0:755"
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
# steamify-prepare.sh [steamify checkout]: puts the Steamify bundle on the
# ISO (archiso/airootfs/usr/local/share/steamify/steamify.sh), used by the
# installer's Steamify step. Built from a checkout when given, else the
# newest release. Run before buildiso.sh.
set -euo pipefail
dest="$(cd "$(dirname "$0")" && pwd)/archiso/airootfs/usr/local/share/steamify/steamify.sh"
mkdir -p "$(dirname "$dest")"
if [[ -n "${1:-}" ]]; then
(cd "$1" && .github/tools/bundle.sh "$dest")
else
curl -fsSL https://github.com/theupriser/steamify-cachyos/releases/latest/download/steamify.sh -o "$dest"
fi
grep -q -- '--defaults' "$dest" || { echo "This Steamify has no --defaults (needs 2.6.0 or newer)." >&2; exit 1; }
chmod 755 "$dest"
echo "Steamify $(grep -m1 '^VERSION=' "$dest" | cut -d= -f2) on the ISO."