From a561b705257f36848cd43135fb30d291692ca195 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Fri, 20 Oct 2023 09:03:12 +0200 Subject: [PATCH] backup stable-confusion.r --- nixos/machines/chungus/media-curl.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/nixos/machines/chungus/media-curl.nix b/nixos/machines/chungus/media-curl.nix index 654d22a..8eba567 100644 --- a/nixos/machines/chungus/media-curl.nix +++ b/nixos/machines/chungus/media-curl.nix @@ -2,20 +2,30 @@ with lib; let configuration = { - Chaospott37C3Tickets = { + Chaospott37C3Tickets = rec { url = "https://md.chaospott.de/171s8-_cQCyX_tUca_Jxqw/download"; target = "/media/curl/37C3"; - output = "$( date +%H:%M:%S )-TicketPlaning.md"; + options = [ + "-o $( date +%H:%M:%S )-TicketPlaning.md" + ]; + }; + StableConfussion = { + url = "http://stable-confusion.r/outputs/"; + target = "/media/curl/stable-confusion"; + options = [ "--mirror" ]; + command = "wget"; }; }; downloadScript = name: { url + , options , target - , output + , command ? "curl" }: pkgs.writers.writeDash "curl-script-${name}" '' mkdir -p "${target}" - curl "${url}" -o "${target}/${output}" + cd "${target}" + ${command} ${concatStringsSep " " options} "${url}" ''; in @@ -23,7 +33,7 @@ in systemd.services.curl-download = { after = [ "network.target" ]; - path = [ pkgs.curl ]; + path = [ pkgs.curl pkgs.wget ]; serviceConfig = { User = "media"; Group = "media";