-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from stefanjenkner/add-support-for-debian-boo…
…kworm Add support for Debian Bookworm
- Loading branch information
Showing
4 changed files
with
333 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
#cloud-config | ||
|
||
bootcmd: | ||
- dpkg --add-architecture i386 | ||
- wget http://repo.steampowered.com/steam/archive/stable/steam.gpg -P /usr/share/keyrings/ | ||
|
||
apt: | ||
preserve_sources_list: false | ||
sources: | ||
steam-stable.list: | ||
source: | | ||
deb [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam | ||
deb-src [arch=amd64,i386 signed-by=/usr/share/keyrings/steam.gpg] https://repo.steampowered.com/steam/ stable steam | ||
conf: | | ||
APT { | ||
Install-Suggests "0"; | ||
Install-Recommends "0"; | ||
} | ||
package_update: true | ||
packages: | ||
- adwaita-icon-theme-full | ||
- alsa-utils | ||
- awscli | ||
- baobab | ||
- build-essential | ||
- dkms | ||
- dmz-cursor-theme | ||
- gdm3 | ||
- gedit | ||
- gnome-control-center | ||
- gnome-session | ||
- gnome-shell-extension-appindicator | ||
- gnome-terminal | ||
- httpie | ||
- libc6-dev | ||
- libcanberra-pulse | ||
- libglvnd-dev | ||
- libva-drm2 | ||
- libva2 | ||
- libvdpau1 | ||
- libvulkan1 | ||
- linux-headers-cloud-amd64 | ||
- linux-image-cloud-amd64 | ||
- nautilus | ||
- pkg-config | ||
- pulseaudio | ||
- pulseaudio-module-gsettings | ||
- restic | ||
- steam-launcher | ||
- steam-libs-amd64 | ||
- unzip | ||
- xdg-desktop-portal-gtk | ||
- xdg-utils | ||
- xserver-xorg-core | ||
- xserver-xorg-dev | ||
- xserver-xorg-input-libinput | ||
|
||
# required on first boot only | ||
fs_setup: | ||
- label: instance_storage | ||
device: /dev/nvme1n1 | ||
filesystem: ext4 | ||
|
||
mounts: | ||
- ["/dev/nvme1n1", "/mnt", "ext4", "defaults,nofail,x-systemd.requires=cloud-init.service,x-systemd.makefs", "0", "2"] | ||
|
||
users: | ||
- default | ||
- name: sunshine | ||
gecos: Sunshine | ||
groups: users, audio, video, plugdev, netdev, input | ||
shell: /bin/bash | ||
|
||
write_files: | ||
- path: /etc/modprobe.d/blacklist.conf | ||
content: | | ||
blacklist vga16fb | ||
blacklist nouveau | ||
blacklist rivafb | ||
blacklist nvidiafb | ||
blacklist rivatv | ||
- path: /etc/modprobe.d/nvidia.conf | ||
content: | | ||
options nvidia NVreg_EnableGpuFirmware=0 | ||
- path: /etc/gdm3/daemon.conf | ||
content: | | ||
[daemon] | ||
WaylandEnable = false | ||
AutomaticLoginEnable = true | ||
AutomaticLogin = sunshine | ||
[security] | ||
[xdmcp] | ||
- path: /etc/udev/rules.d/85-sunshine-input.rules | ||
content: | | ||
KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput" | ||
- path: /opt/sunshine_systemd_user_service.patch | ||
content: | | ||
5,7c5 | ||
< PartOf=graphical-session.target | ||
< Wants=xdg-desktop-autostart.target | ||
< After=xdg-desktop-autostart.target | ||
--- | ||
> After=graphical-session.target | ||
15c13 | ||
< WantedBy=xdg-desktop-autostart.target | ||
--- | ||
> WantedBy=graphical-session.target | ||
- path: /opt/install_nvidia_driver.sh | ||
content: | | ||
#!/bin/bash | ||
set -euo pipefail | ||
cd /mnt | ||
aws s3 cp --recursive s3://nvidia-gaming/linux/latest/ . | ||
unzip *Cloud_Gaming-Linux-Guest-Drivers.zip -d nvidia-drivers | ||
rm -f *Cloud_Gaming-Linux-Guest-Drivers.zip | ||
chmod +x ./nvidia-drivers/*Cloud_Gaming-Linux-Guest-Drivers/NVIDIA-Linux-x86_64*-grid.run | ||
/bin/sh ./nvidia-drivers/*Cloud_Gaming-Linux-Guest-Drivers/NVIDIA-Linux-x86_64*-grid.run --dkms --tmpdir=/mnt --silent | ||
rm -rf ./nvidia-drivers/ | ||
kversion=$(linux-version list |sort |tail -n1) | ||
dkms autoinstall -k $kversion | ||
update-initramfs -k $kversion -u | ||
cat << EOF | tee -a /etc/nvidia/gridd.conf | ||
vGamingMarketplace=2 | ||
EOF | ||
curl -o /etc/nvidia/GridSwCert.txt "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertLinux_2021_10_2.cert" | ||
nvidia-xconfig --preserve-busid --enable-all-gpus | ||
nvidia-smi -q | head | ||
permissions: '0755' | ||
- path: /etc/systemd/system/init_mnt.service | ||
content: | | ||
[Unit] | ||
After = network-online.target | ||
Wants = network-online.target | ||
[Service] | ||
Type = oneshot | ||
RemainAfterExit = yes | ||
ExecStart = mkdir -p /mnt/sunshine | ||
ExecStart = chown sunshine:sunshine /mnt/sunshine | ||
[Install] | ||
WantedBy = multi-user.target | ||
- path: /home/admin/.bash_history | ||
content: | | ||
sudo reboot | ||
sudo /opt/install_nvidia_driver.sh | ||
tail -f /var/log/cloud-init.log | ||
owner: admin:admin | ||
permissions: '0600' | ||
defer: true | ||
- path: /usr/lib/systemd/user/init_desktop_settings.service | ||
content: | | ||
[Unit] | ||
Description=Init desktop settings | ||
[Service] | ||
Type = oneshot | ||
RemainAfterExit = yes | ||
ExecStart=/usr/bin/gnome-extensions enable [email protected] | ||
ExecStart=/usr/bin/gsettings set org.gnome.desktop.background picture-uri "file:///usr/share/backgrounds/gnome/adwaita-l.webp" | ||
ExecStart=/usr/bin/gsettings set org.gnome.desktop.interface enable-hot-corners false | ||
[Install] | ||
WantedBy=graphical-session.target | ||
permissions: '0644' | ||
- path: /etc/profile.d/restic.sh | ||
content: | | ||
#!/bin/sh | ||
export RESTIC_REPOSITORY=s3:https://s3.eu-central-1.amazonaws.com/ec2-gaming-sunshine-library | ||
export RESTIC_PASSWORD=sunshine | ||
permissions: '0644' | ||
- path: /usr/local/bin/backup | ||
content: | | ||
#!/bin/sh | ||
restic snapshots || restic init | ||
restic backup /mnt/sunshine | ||
permissions: '0755' | ||
defer: true | ||
- path: /usr/local/bin/restore | ||
content: | | ||
#!/bin/sh | ||
restic snapshots && \ | ||
restic restore latest -v --target / --host $(hostname -s) | ||
read -p "press any key" | ||
permissions: '0755' | ||
defer: true | ||
- path: /usr/local/share/applications/restore.desktop | ||
content: | | ||
[Desktop Entry] | ||
Type=Application | ||
Name=Restore | ||
Exec=/usr/local/bin/restore | ||
Terminal=true | ||
permissions: '0644' | ||
defer: true | ||
- path: /usr/local/share/applications/backup.desktop | ||
content: | | ||
[Desktop Entry] | ||
Type=Application | ||
Name=Backup | ||
Exec=/usr/local/bin/backup | ||
Terminal=true | ||
permissions: '0644' | ||
defer: true | ||
|
||
runcmd: | ||
- systemctl enable init_mnt | ||
- rm -f /etc/apt/sources.list.d/steam.list | ||
- apt update | ||
- apt install -y libgl1-mesa-dri:i386 steam-libs-i386:i386 libgl1-mesa-dri:amd64 libgl1-mesa-glx:i386 libgl1-mesa-glx:amd64 libvulkan1:i386 libgnutls30:i386 | ||
- wget https://github.com/LizardByte/Sunshine/releases/download/v0.23.1/sunshine-debian-bookworm-amd64.deb | ||
- apt install -y ./sunshine-debian-bookworm-amd64.deb | ||
- rm -f ./sunshine-debian-bookworm-amd64.deb | ||
- patch /usr/lib/systemd/user/sunshine.service < /opt/sunshine_systemd_user_service.patch | ||
- su -c "systemctl --user enable sunshine" sunshine | ||
- su -c "systemctl --user enable init_desktop_settings" sunshine | ||
- su -c "desktop-file-install --dir=/home/sunshine/.config/autostart /usr/local/share/applications/restore.desktop" sunshine | ||
- wget https://github.com/lutris/lutris/releases/download/v0.5.14/lutris_0.5.14_all.deb | ||
- apt-get install -y ./lutris_0.5.14_all.deb |
Oops, something went wrong.