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 # Create videos directory, allow anyone in Jellyfin group to manage it
system.activationScripts.jellyfin = let videosDirectory = "/var/videos"; systemd.services.videos-library = {
in { wantedBy = [ "jellyfin.service" ];
text = '' requiredBy = [ "jellyfin.service" ];
if [ ! -d "${videosDirectory}" ]; then before = [ "jellyfin.service" ];
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG ${videosDirectory} serviceConfig = {
$DRY_RUN_CMD chmod 775 $VERBOSE_ARG ${videosDirectory} Type = "oneshot";
fi 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, ... }: { config, pkgs, lib, ... }:
let let
adminpassFile = "/var/lib/nextcloud/creds"; adminpassFile = "/var/lib/nextcloud/creds";
backupS3File = "/var/lib/nextcloud/backup-creds"; backupS3File = "/var/lib/nextcloud/backup-creds";
@ -147,7 +148,7 @@ in {
before = [ "litestream.service" ]; before = [ "litestream.service" ];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "root"; RemainAfterExit = true;
}; };
script = '' script = ''
echo \ echo \