From d14a5acc474bdf967ef1f97113109cabede6ca43 Mon Sep 17 00:00:00 2001 From: Ivan Dimitrov Date: Sun, 21 Apr 2024 23:54:04 +0300 Subject: [PATCH] bingwp on server --- mailserver/configuration.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mailserver/configuration.nix b/mailserver/configuration.nix index 58f97cf..d113fb3 100644 --- a/mailserver/configuration.nix +++ b/mailserver/configuration.nix @@ -56,4 +56,23 @@ }; }; }; + systemd = { + timers = { + bingwp = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "*-*-* 10:00:00"; + Persistent = true; + }; + }; + }; + services = { + bingwp = { + description = "Download bing image of the day"; + script = '' + ${pkgs.nushell}/bin/nu -c "http get ('https://bing.com' + ((http get https://www.bing.com/HPImageArchive.aspx?format=js&n=1).images.0.url)) | save ('/var/pic' | path join ( [ (date now | format date '%Y-%m-%d'), '.png' ] | str join ))" + ''; + }; + }; + }; }