From 0aaf692b4ba933b5a6a1a0fddc76942ff825ee6a Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Tue, 3 Sep 2024 01:43:30 -0600 Subject: [PATCH] sub-sync turned into a path based executable --- modules/servers/jellyfin.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/servers/jellyfin.nix b/modules/servers/jellyfin.nix index 70c3ac6..0c18608 100644 --- a/modules/servers/jellyfin.nix +++ b/modules/servers/jellyfin.nix @@ -3,11 +3,22 @@ let cfg = config.my.servers.jellyfin; sub-sync = pkgs.writeScriptBin "sub-sync" (builtins.readFile ../../scripts/sub-sync.sh); + sub-sync-path = [ + pkgs.nix + pkgs.bash + pkgs.fd + pkgs.ripgrep + pkgs.file + pkgs.alass + pkgs.ffmpeg + pkgs.gum + sub-sync + ]; in { options.my.servers.jellyfin = setup.mkOptions "jellyfin" "flix" 8096; config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.jellyfin-ffmpeg ] - ++ (if cfg.enableCron then [ sub-sync ] else [ ]); + ++ (if cfg.enableCron then sub-sync-path else [ ]); services = { jellyfin = { enable = true; @@ -107,12 +118,12 @@ in { restartIfChanged = true; description = "syncronizes subtitles downloaded & modified today"; wantedBy = [ "default.target" ]; - path = [ pkgs.nix sub-sync ]; + path = sub-sync-path; serviceConfig = { Restart = "on-failure"; RestartSec = 30; ExecStart = "${sub-sync}/bin/sub-sync all"; - Type = "forking"; + Type = "simple"; User = "root"; }; };