diff --git a/modules/home-manager/services/yt-dlp.nix b/modules/home-manager/services/yt-dlp.nix index 26bb97f8..a446c495 100644 --- a/modules/home-manager/services/yt-dlp.nix +++ b/modules/home-manager/services/yt-dlp.nix @@ -127,7 +127,6 @@ in { }; Service = { - WorkingDirectory = cfg.archivePath; ExecStartPre = '' ${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p ${ lib.escapeShellArg cfg.archivePath @@ -141,7 +140,7 @@ in { lib.concatStringsSep " " cfg.extraArgs } ${lib.concatStringsSep " " value.extraArgs} ${ lib.escapeShellArgs value.urls - } + } --paths ${lib.escapeShellArg cfg.archivePath} ''; in "${archiveScript}/bin/${scriptName}"; }; diff --git a/modules/nixos/services/yt-dlp.nix b/modules/nixos/services/yt-dlp.nix index 86a17220..d34687f6 100644 --- a/modules/nixos/services/yt-dlp.nix +++ b/modules/nixos/services/yt-dlp.nix @@ -119,19 +119,21 @@ in { documentation = [ "man:yt-dlp(1)" ]; enable = true; path = [ cfg.package pkgs.coreutils ]; + preStart = '' + mkdir -p ${lib.escapeShellArg cfg.archivePath} + ''; script = '' - mkdir -p ${lib.escapeShellArg cfg.archivePath} \ - && yt-dlp ${lib.concatStringsSep " " cfg.extraArgs} ${ + yt-dlp ${lib.concatStringsSep " " cfg.extraArgs} ${ lib.concatStringsSep " " value.extraArgs - } ${lib.escapeShellArgs value.urls} + } ${lib.escapeShellArgs value.urls} --paths ${cfg.archivePath} ''; startAt = value.startAt; serviceConfig = { NoNewPrivileges = true; PrivateTmp = true; - ProtectControlGroup = true; + ProtectControlGroups = true; ProtectClock = true; - ProtectKernelModule = true; + ProtectKernelModules = true; ProtectKernelLogs = true; }; }) cfg.jobs;