mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
services/yt-dlp: fix service working directory
There is the `--paths` option for that purpose. It also eliminates the workaround for creating the directory before starting the service for newly-bootstrapped systems. The several hardening options have also been corrected.
This commit is contained in:
parent
da25de06ee
commit
c0dd8ab1a8
@ -127,7 +127,6 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
WorkingDirectory = cfg.archivePath;
|
|
||||||
ExecStartPre = ''
|
ExecStartPre = ''
|
||||||
${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p ${
|
${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p ${
|
||||||
lib.escapeShellArg cfg.archivePath
|
lib.escapeShellArg cfg.archivePath
|
||||||
@ -141,7 +140,7 @@ in {
|
|||||||
lib.concatStringsSep " " cfg.extraArgs
|
lib.concatStringsSep " " cfg.extraArgs
|
||||||
} ${lib.concatStringsSep " " value.extraArgs} ${
|
} ${lib.concatStringsSep " " value.extraArgs} ${
|
||||||
lib.escapeShellArgs value.urls
|
lib.escapeShellArgs value.urls
|
||||||
}
|
} --paths ${lib.escapeShellArg cfg.archivePath}
|
||||||
'';
|
'';
|
||||||
in "${archiveScript}/bin/${scriptName}";
|
in "${archiveScript}/bin/${scriptName}";
|
||||||
};
|
};
|
||||||
|
@ -119,19 +119,21 @@ in {
|
|||||||
documentation = [ "man:yt-dlp(1)" ];
|
documentation = [ "man:yt-dlp(1)" ];
|
||||||
enable = true;
|
enable = true;
|
||||||
path = [ cfg.package pkgs.coreutils ];
|
path = [ cfg.package pkgs.coreutils ];
|
||||||
|
preStart = ''
|
||||||
|
mkdir -p ${lib.escapeShellArg cfg.archivePath}
|
||||||
|
'';
|
||||||
script = ''
|
script = ''
|
||||||
mkdir -p ${lib.escapeShellArg cfg.archivePath} \
|
yt-dlp ${lib.concatStringsSep " " cfg.extraArgs} ${
|
||||||
&& yt-dlp ${lib.concatStringsSep " " cfg.extraArgs} ${
|
|
||||||
lib.concatStringsSep " " value.extraArgs
|
lib.concatStringsSep " " value.extraArgs
|
||||||
} ${lib.escapeShellArgs value.urls}
|
} ${lib.escapeShellArgs value.urls} --paths ${cfg.archivePath}
|
||||||
'';
|
'';
|
||||||
startAt = value.startAt;
|
startAt = value.startAt;
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
NoNewPrivileges = true;
|
NoNewPrivileges = true;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
ProtectControlGroup = true;
|
ProtectControlGroups = true;
|
||||||
ProtectClock = true;
|
ProtectClock = true;
|
||||||
ProtectKernelModule = true;
|
ProtectKernelModules = true;
|
||||||
ProtectKernelLogs = true;
|
ProtectKernelLogs = true;
|
||||||
};
|
};
|
||||||
}) cfg.jobs;
|
}) cfg.jobs;
|
||||||
|
Loading…
Reference in New Issue
Block a user