summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/comic-updater.nix
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/bureautomation/comic-updater.nix')
-rw-r--r--makefu/2configs/bureautomation/comic-updater.nix37
1 files changed, 0 insertions, 37 deletions
diff --git a/makefu/2configs/bureautomation/comic-updater.nix b/makefu/2configs/bureautomation/comic-updater.nix
deleted file mode 100644
index 5804d66d..00000000
--- a/makefu/2configs/bureautomation/comic-updater.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ config, lib, pkgs, buildPythonPackage, ... }:
-
-let
- mq = "192.168.8.11";
- pkg = pkgs.ampel;
-in {
- systemd.services.comic-updater = {
- startAt = "daily";
- description = "update our comics";
- after = [ "network-online.target" ] ++ (lib.optional config.services.mosquitto.enable "mosquitto.service");
- path = with pkgs; [ wget xmlstarlet ];
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- # User = "hass";
- #WorkingDirectory = config.services.home-assistant.configDir;
- WorkingDirectory = "/var/lib/homeassistant-docker";
- ExecStart = pkgs.writeDash "update-comics" ''
- set -euf
- mkdir -p www/
- cd www/
- # poorly drawn lines
- pic=$(wget -O- http://www.poorlydrawnlines.com/feed/ \
- | xml sel -t -v '/rss/channel/item/content:encoded' \
- | head -n 2 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' )
- wget "$pic" -nc && cp -v "$(basename "$pic")" lines.png
-
- #pic=$(curl -L xkcd.com 2>/dev/null | grep imgs.xkcd.com | grep title | sed -n 's/.*src="\([^"]\+\)" .*/https:\1/p')
- # xkcd
- pic=$(wget -O- https://xkcd.com/rss.xml \
- | xml sel -t -v '/rss/channel/item/description' \
- | head -n 1 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' )
- wget "$pic" -nc && cp -v "$(basename "$pic")" xkcd.png
- '';
- PrivateTmp = true;
- };
- };
-}