replace activationscripts with systemd

This commit is contained in:
Noah Masur 2022-10-09 03:51:25 +00:00
parent 5872abcc33
commit e309889b0b
2 changed files with 14 additions and 8 deletions

View File

@ -20,13 +20,18 @@
}];
# 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
systemd.services.videos-library = {
wantedBy = [ "jellyfin.service" ];
requiredBy = [ "jellyfin.service" ];
before = [ "jellyfin.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = let videosDirectory = "/var/videos";
in ''
mkdir --parents --mode 0755 ${videosDirectory}
chown jellyfin:jellyfin ${videosDirectory}
'';
};

View File

@ -1,6 +1,7 @@
{ config, pkgs, lib, ... }:
let
adminpassFile = "/var/lib/nextcloud/creds";
backupS3File = "/var/lib/nextcloud/backup-creds";
@ -147,7 +148,7 @@ in {
before = [ "litestream.service" ];
serviceConfig = {
Type = "oneshot";
User = "root";
RemainAfterExit = true;
};
script = ''
echo \