From 6b4687cbf8c5ab13224c94b16ea6f2a4c558d9dd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 24 Aug 2024 00:07:29 +0200 Subject: ... --- accounts/gkleen@sif/systemd.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'accounts/gkleen@sif') diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index b7bf902e..db679c97 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix @@ -37,7 +37,7 @@ let ${pkgs.coreutils}/bin/sleep 0.1 done - ${pkgs.systemd}/bin/systemd-notify --ready + ${config.systemd.package}/bin/systemd-notify --ready wait "''${pid}" "''${newpid}" ''; @@ -281,7 +281,7 @@ in { "yt-dlp@" = { Service = { Type = "notify"; - RuntimeDirectory = "%N"; + CacheDirectory = "yt-dlp/%N"; StandardInput = "socket"; StandardOutput = "journal"; WatchdogSec = "10s"; @@ -309,7 +309,7 @@ in { 'progress_delta': 5, 'paths': { 'home': str(Path.home() / 'media'), - 'temp': str(Path(environ['RUNTIME_DIRECTORY'])), + 'temp': str(Path(environ['CACHE_DIRECTORY'])), }, **(args['params'] if 'params' in args else {}), } @@ -317,6 +317,7 @@ in { n.notify('READY=1') ytdl.download(args['urls']) ''; + ExecStopPost = "${pkgs.coreutils}/bin/rm -rfv \"$CACHE_DIRECTORY\""; }; }; } // listToAttrs (map ({host, port}: nameValuePair "proxy-to-autossh-socks@${toString port}" { @@ -325,7 +326,7 @@ in { After = ["autossh-socks@${host}:${toString (port + 1)}.service" "proxy-to-autossh-socks@${toString port}.socket"]; }; Service = { - ExecStart = "${pkgs.systemd}/lib/systemd/systemd-socket-proxyd --exit-idle-time=10s localhost:${toString (port + 1)}"; + ExecStart = "${config.systemd.package}/lib/systemd/systemd-socket-proxyd --exit-idle-time=10s localhost:${toString (port + 1)}"; }; }) [{ host = "proxy.mathw0h"; port = 8118; } { host = "proxy.vidhar"; port = 8120; }]); sockets = listToAttrs (map (port: nameValuePair "proxy-to-autossh-socks@${toString port}" { -- cgit v1.2.3