diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-24 00:07:29 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-24 00:07:29 +0200 |
commit | 6b4687cbf8c5ab13224c94b16ea6f2a4c558d9dd (patch) | |
tree | 8edc1c7355bad75bf958a8ec32a1364dd2a9e25a | |
parent | 8416f910acaf9a4e35f19d87582cec8cc96f1121 (diff) | |
download | nixos-6b4687cbf8c5ab13224c94b16ea6f2a4c558d9dd.tar nixos-6b4687cbf8c5ab13224c94b16ea6f2a4c558d9dd.tar.gz nixos-6b4687cbf8c5ab13224c94b16ea6f2a4c558d9dd.tar.bz2 nixos-6b4687cbf8c5ab13224c94b16ea6f2a4c558d9dd.tar.xz nixos-6b4687cbf8c5ab13224c94b16ea6f2a4c558d9dd.zip |
...
-rw-r--r-- | accounts/gkleen@sif/systemd.nix | 9 |
1 files changed, 5 insertions, 4 deletions
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 | |||
37 | ${pkgs.coreutils}/bin/sleep 0.1 | 37 | ${pkgs.coreutils}/bin/sleep 0.1 |
38 | done | 38 | done |
39 | 39 | ||
40 | ${pkgs.systemd}/bin/systemd-notify --ready | 40 | ${config.systemd.package}/bin/systemd-notify --ready |
41 | 41 | ||
42 | wait "''${pid}" "''${newpid}" | 42 | wait "''${pid}" "''${newpid}" |
43 | ''; | 43 | ''; |
@@ -281,7 +281,7 @@ in { | |||
281 | "yt-dlp@" = { | 281 | "yt-dlp@" = { |
282 | Service = { | 282 | Service = { |
283 | Type = "notify"; | 283 | Type = "notify"; |
284 | RuntimeDirectory = "%N"; | 284 | CacheDirectory = "yt-dlp/%N"; |
285 | StandardInput = "socket"; | 285 | StandardInput = "socket"; |
286 | StandardOutput = "journal"; | 286 | StandardOutput = "journal"; |
287 | WatchdogSec = "10s"; | 287 | WatchdogSec = "10s"; |
@@ -309,7 +309,7 @@ in { | |||
309 | 'progress_delta': 5, | 309 | 'progress_delta': 5, |
310 | 'paths': { | 310 | 'paths': { |
311 | 'home': str(Path.home() / 'media'), | 311 | 'home': str(Path.home() / 'media'), |
312 | 'temp': str(Path(environ['RUNTIME_DIRECTORY'])), | 312 | 'temp': str(Path(environ['CACHE_DIRECTORY'])), |
313 | }, | 313 | }, |
314 | **(args['params'] if 'params' in args else {}), | 314 | **(args['params'] if 'params' in args else {}), |
315 | } | 315 | } |
@@ -317,6 +317,7 @@ in { | |||
317 | n.notify('READY=1') | 317 | n.notify('READY=1') |
318 | ytdl.download(args['urls']) | 318 | ytdl.download(args['urls']) |
319 | ''; | 319 | ''; |
320 | ExecStopPost = "${pkgs.coreutils}/bin/rm -rfv \"$CACHE_DIRECTORY\""; | ||
320 | }; | 321 | }; |
321 | }; | 322 | }; |
322 | } // listToAttrs (map ({host, port}: nameValuePair "proxy-to-autossh-socks@${toString port}" { | 323 | } // listToAttrs (map ({host, port}: nameValuePair "proxy-to-autossh-socks@${toString port}" { |
@@ -325,7 +326,7 @@ in { | |||
325 | After = ["autossh-socks@${host}:${toString (port + 1)}.service" "proxy-to-autossh-socks@${toString port}.socket"]; | 326 | After = ["autossh-socks@${host}:${toString (port + 1)}.service" "proxy-to-autossh-socks@${toString port}.socket"]; |
326 | }; | 327 | }; |
327 | Service = { | 328 | Service = { |
328 | ExecStart = "${pkgs.systemd}/lib/systemd/systemd-socket-proxyd --exit-idle-time=10s localhost:${toString (port + 1)}"; | 329 | ExecStart = "${config.systemd.package}/lib/systemd/systemd-socket-proxyd --exit-idle-time=10s localhost:${toString (port + 1)}"; |
329 | }; | 330 | }; |
330 | }) [{ host = "proxy.mathw0h"; port = 8118; } { host = "proxy.vidhar"; port = 8120; }]); | 331 | }) [{ host = "proxy.mathw0h"; port = 8118; } { host = "proxy.vidhar"; port = 8120; }]); |
331 | sockets = listToAttrs (map (port: nameValuePair "proxy-to-autossh-socks@${toString port}" { | 332 | sockets = listToAttrs (map (port: nameValuePair "proxy-to-autossh-socks@${toString port}" { |