backup stable-confusion.r
This commit is contained in:
parent
c495ba70b6
commit
a561b70525
1 changed files with 15 additions and 5 deletions
|
@ -2,20 +2,30 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
configuration = {
|
configuration = {
|
||||||
Chaospott37C3Tickets = {
|
Chaospott37C3Tickets = rec {
|
||||||
url = "https://md.chaospott.de/171s8-_cQCyX_tUca_Jxqw/download";
|
url = "https://md.chaospott.de/171s8-_cQCyX_tUca_Jxqw/download";
|
||||||
target = "/media/curl/37C3";
|
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 =
|
downloadScript =
|
||||||
name: { url
|
name: { url
|
||||||
|
, options
|
||||||
, target
|
, target
|
||||||
, output
|
, command ? "curl"
|
||||||
}: pkgs.writers.writeDash "curl-script-${name}" ''
|
}: pkgs.writers.writeDash "curl-script-${name}" ''
|
||||||
mkdir -p "${target}"
|
mkdir -p "${target}"
|
||||||
curl "${url}" -o "${target}/${output}"
|
cd "${target}"
|
||||||
|
${command} ${concatStringsSep " " options} "${url}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
@ -23,7 +33,7 @@ in
|
||||||
|
|
||||||
systemd.services.curl-download = {
|
systemd.services.curl-download = {
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
path = [ pkgs.curl ];
|
path = [ pkgs.curl pkgs.wget ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "media";
|
User = "media";
|
||||||
Group = "media";
|
Group = "media";
|
||||||
|
|
Loading…
Reference in a new issue