Why?
My Raspberry Pi goes largely unutilized. This project turns it into a 24/7 server that runs light background services & helps to keep my Linux devices connected.
This project enables the Pi to download music from Spotify for offline listening, backs up my Github repositories, and hosts a LAN HTTP server for monitoring AQI.
USB drives?
The Pi 4 has two USB 3.0 ports for high speed data transfer to connected USB drives.
Devmon automatically mounts & dismounts attached drives (with automount on boot) even without login.
Avahi makes the mount directory publicly available as a network-attached drive so you have read/write access to all connected USB drives, right in your file browser.
I've went for this approach to utilize my vast collection of USB drives. This also makes it easier to store offsite periodical backups. All directories & files are recreated whenever the Pi backs things up, so the drives are easily swappable with no prior configuration needed.

The other cable is powering my air quality monitor
Cron?
Cron is now deprecated within Nix. I'm using systemd timers to run a systemd service at 3AM PT which downloads Spotify playlists using spotdl and clone/pull all personal public & private Github repos.
Both of these backups help to ensure that my data is safe from data loss or any service outage.
Desktop integration
My desktop has an mpd player integrated within the shell. I can play music offline, but syncing music between my three NixOS computers is quite tedious.
My desktop shell now sends a reminder whenever the system hasn't synced with the homelab in over a week.
The sync script downloads all the music from the homelab (the homelab keeps it up-to-date from Spotify) and rebuilds the system to the latest flake commit.
The Astal mpd player pulls from this music, keeping my music synced but allowing me to listen offline.
NAS & Syncing
Within a script, we just need to use the static hostname resolve exposed by Avahi and mount the network drive. Then, we can access and use its files for syncing.
All connected drives are available on the same Samba NAS. If multiple drives are connected, we won't know which drive to use for backups & syncing. All sync & backup scripts check to ensure that only one drive is mounted to prevent this from being an issue.
AQI monitor integration
This Pi also hosts the webserver necessary for recording, storing, and showing air quality data collected by an SDS011 particulate sensor. To see more, check out my air quality monitoring system entry.