Refactor: inject the username into the source path

This commit is contained in:
Oliver Davies 2024-08-20 21:01:07 +01:00
parent ce5b4fa0a1
commit 4d4d65d812
4 changed files with 11 additions and 5 deletions
lib/shared/scripts

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, username, ... }:
{
name = "export-video-list";
@ -12,7 +12,7 @@
device_name="/dev/sda2"
device_label="UNTITLED"
source_path="/run/media/opdavies/$device_label"
source_path="/run/media/${username}/$device_label"
# If the source path doesn't exist, try mounting the device.
if [[ ! -d "$source_path" ]]; then