<p>My first attempt was to setup Syncthing as a system-wide service managed by
<codeclass="language-plaintext highlighter-rouge">systemd</code>, installed via <codeclass="language-plaintext highlighter-rouge">pacman</code>. There are several problems with this. First,
it requires disabling the read-only file-system. Next, <codeclass="language-plaintext highlighter-rouge">pacman</code> is not setup nor
reliable, since every SteamOS update will over-write any changes I make to any
of the read-only file-system, including the directories that <codeclass="language-plaintext highlighter-rouge">pacman</code> relies on.
Related, the update will also erase the Syncthing package. This means I either
never update (inadvisable, and unacceptable), or I setup Syncthing not in the
read-only file-system.</p>
<h3id="the-right-way-user-services">The Right Way: User Services</h3>
<p>systemd allows for non-root-based services, called user services. The Arch Wiki
<li>No root privileges are required. No modifying the read-only file-system</li>
</ul>
<h2id="syncthing">Syncthing</h2>
<p>Syncthing is incredible. I’ve <ahref="2020/07/19/syncthing-part-1.html">written about it
before</a>, but the setup here is a bit more
involved. The Steam Deck runs Arch Linux (and have I told you yet today that I
do too?), so the Arch Wiki <ahref="https://wiki.archlinux.org/title/Syncthing">article on
Syncthing</a> gives some good insight.
When I initially started this process, I installed the SyncthingGTK application
from the Discover Store. This means it is a Flatpak application, and so doesn’t
require elevated user privileges. I also tried the Syncthingy application, which
explicitly calls out Steam Deck users. However, both require running the Flatpak
in the background (like some users do for Discord or Spotify). I don’t like
this, it feels off, and thus I sought a different approach.</p>
<h2id="sshd-still-incredibly-useful">SSHD: Still Incredibly Useful</h2>
<p>I got real tired real quick of using the on-screen keyboard. After
complaining, a friend recommended I enable <codeclass="language-plaintext highlighter-rouge">sshd</code> and just remote in to the
device. Doing so was a breeze, and I recommend to others who don’t have a
physical keyboard they can plug into their device. Drop to desktop mode
(hold the power button for a few seconds, and select the option), and start a
terminal (default is Konsole). Before remotely accessing the device, or using
elevated privileges via <codeclass="language-plaintext highlighter-rouge">sudo</code>, I need to set a password for the default user,
<em>deck</em>. In the terminal, type <codeclass="language-plaintext highlighter-rouge">passwd</code> and set it (and then put it in your
password vault so you don’t forget. You <em>do</em> have a password vault, right?).
Start the service, <codeclass="language-plaintext highlighter-rouge">sudo systemctl start sshd</code>, and optionally enable it to have
<codeclass="language-plaintext highlighter-rouge">sshd</code> automatically started on each boot (<codeclass="language-plaintext highlighter-rouge">sudo systemctl enable sshd</code>). Get
the device IP with <codeclass="language-plaintext highlighter-rouge">ip addr list</code>, from my desktop run <codeclass="language-plaintext highlighter-rouge">ssh deck@ip-address</code>,
type in the password, and now I’m a grade-A Hackermans.</p>
<p>This setting is not reset on SteamOS updates, that I can tell. Once enabled,
this will always start at boot, and always be on until explicitly turned off. Be
mindful of that if you decide to wander away from your home network; maybe turn
it off in public if you don’t need it.</p>
<h2id="setup">Setup</h2>
<p>There are 2 things required: a systemd service file, and the <codeclass="language-plaintext highlighter-rouge">syncthing</code>
binary. Syncthing is written in Go, and a compiled binary can be downloaded that
has no dependencies or installation requirements. It can be downloaded from
the <ahref="https://github.com/syncthing/syncthing/releases/tag/v1.20.3">Syncthing
Releases</a> page for
many platforms and architectures. The Steam Deck is a Linux platform, using the
AMD64 architecture (or x86_64), so I grab that one. I’ll note here, since I have
SSH access, I do all the editing and downloading on my desktop, and then
transfer the files using <codeclass="language-plaintext highlighter-rouge">scp</code> to the Deck. All of these steps can be done on
the Deck itself, without SSH access. Once the proper tarball has been
downloaded, extract it, and within will be the <codeclass="language-plaintext highlighter-rouge">syncthing</code> binary, ready to
rock. I copy/move the binary to <codeclass="language-plaintext highlighter-rouge">~/.local/bin/syncthing</code> on the Deck. The exact
location is less important than ensuring the binary is within my home directory
on the Deck.</p>
<p>The systemd serivce file can also be taken from the extracted tarball, but
requires modification. In the tarball, it is
<codeclass="language-plaintext highlighter-rouge">etc/linux-systemd/user/syncthing.service</code>. Copy this file to
<codeclass="language-plaintext highlighter-rouge">~/.config/systemd/user</code> on the Deck, and edit the “ExecStart” line in the