From a9ae0c8858495b836c6871ed380b79559dfefacc Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 4 Oct 2022 22:59:28 +0000 Subject: [PATCH] add activationscript for jellyfin directory --- modules/services/jellyfin.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/services/jellyfin.nix b/modules/services/jellyfin.nix index c866cc0..33828d9 100644 --- a/modules/services/jellyfin.nix +++ b/modules/services/jellyfin.nix @@ -18,6 +18,18 @@ upstreams = [{ dial = "localhost:8096"; }]; }]; }]; + + # Create videos directory, allow anyone in Jellyfin group to manage it + system.activationScripts.jellyfin = let videosDirectory = "/var/videos"; + in { + text = '' + if [ ! -d "${videosDirectory}" ]; then + $DRY_RUN_CMD mkdir --parents $VERBOSE_ARG ${videosDirectory} + $DRY_RUN_CMD chmod 775 $VERBOSE_ARG ${videosDirectory} + fi + ''; + }; + }; }