From e284da85a4dfc2f65ecf9c0ca257487eb90baf06 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 6 Apr 2020 10:13:24 +0200 Subject: ma feed.euer.krebsco.de: init --- .../deployment/feed.euer.krebsco.de/default.nix | 52 ++++++++++++++++++++++ .../deployment/feed.euer.krebsco.de/filter.yml | 49 ++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 makefu/2configs/deployment/feed.euer.krebsco.de/default.nix create mode 100644 makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml (limited to 'makefu') diff --git a/makefu/2configs/deployment/feed.euer.krebsco.de/default.nix b/makefu/2configs/deployment/feed.euer.krebsco.de/default.nix new file mode 100644 index 00000000..de072092 --- /dev/null +++ b/makefu/2configs/deployment/feed.euer.krebsco.de/default.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: +let + filter-file = ./filter.yml; + pkg = with pkgs.python3Packages;buildPythonPackage rec { + version = "d16ce227dc68c9f60f6dd06e6835bab7cdfdf61b"; + pname = "ebk-notify"; + propagatedBuildInputs = [ + docopt + pyyaml + requests + beautifulsoup4 + dateutil + feedgen + ]; + src = pkgs.fetchgit { + url = "http://cgit.euer.krebsco.de/ebk-notify"; + rev = version; + sha256 = "15dlhp17alm01fw7mzdyh2z9zwz8psrs489lxs3hgg1p5wa0kzsp"; + }; + }; + domain = "feed.euer.krebsco.de"; + path = "/var/www/feed.euer.krebsco.de"; +in +{ + systemd.tmpfiles.rules = [ + "d ${path} nginx nogroup - -" + ]; + krebs.secret.files.ebknotify = { + path = "/etc/ebk-notify.yml"; + owner.name = "nginx"; + source-path = "${}"; + }; + systemd.services.ebk-notify = { + startAt = "*:0/10"; + serviceConfig = { + User = "nginx"; # TODO better permission setting + # PrivateTmp = true; + ExecStart = "${pkg}/bin/ebk-notify --atom --outdir ${path} --config /etc/ebk-notify.yml --cache /tmp/ebk-cache.json --filter ${filter-file} --wait 30"; + }; + }; + systemd.timers.ebk-notify.timerConfig.RandomizedDelaySec = "120"; + services.nginx = { + virtualHosts."${domain}" = { + forceSSL = true; + enableACME = true; + locations."/" = { + root = path; + index = "root.atom"; + }; + }; + }; +} diff --git a/makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml b/makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml new file mode 100644 index 00000000..036f67e5 --- /dev/null +++ b/makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml @@ -0,0 +1,49 @@ +- name: Free Stuff by Category + zipcode: 70378 + distance: 2 + categoryId: 192 +- name: Kies + zipcode: 70378 + q: grobkies + distance: 2 +- name: pflanzkübel + zipcode: 70378 + q: Pflanzkübel + distance: 3 +- name: Ikea Samla + zipcode: 70378 + q: samla + distance: 5 +- name: Duplo + zipcode: 70378 + q: Duplo + distance: 10 +- name: Valve Index + q: Valve Index + maxPrice: 1300 + minPrice: 500 + locationId: 3331 +- name: Baby Gummistiefel + zipcode: 70378 + q: Gummistiefel + distance: 5 +- name: Werkbank + zipcode: 70378 + q: Werkbank + distance: 5 +- name: Stirnthermometer + zipcode: 70378 + q: Stirnthermometer + distance: 5 +- name: Ohrthermometer + zipcode: 70378 + q: Ohrthermometer + distance: 5 +- name: Fieberthermometer + zipcode: 70378 + q: Fieberthermometer + distance: 5 +- name: Einhell + zipcode: 70378 + q: Einhell + distance: 5 -- cgit v1.2.3 From 2dfadc18518900d48bd367c18d894a91b7bf2a77 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 6 Apr 2020 10:14:41 +0200 Subject: ma feed.euer: remove valve --- makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml | 5 ----- 1 file changed, 5 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml b/makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml index 036f67e5..50058f32 100644 --- a/makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml +++ b/makefu/2configs/deployment/feed.euer.krebsco.de/filter.yml @@ -18,11 +18,6 @@ zipcode: 70378 q: Duplo distance: 10 -- name: Valve Index - q: Valve Index - maxPrice: 1300 - minPrice: 500 - locationId: 3331 - name: Baby Gummistiefel zipcode: 70378 q: Gummistiefel -- cgit v1.2.3 From 0b371833e9ef68fd891fac65a657d8e38b5b3fad Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 19 Apr 2020 21:24:52 +0200 Subject: ma ham: add the_playlist --- makefu/2configs/ham/default.nix | 2 ++ makefu/2configs/ham/multi/the_playlist.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 makefu/2configs/ham/multi/the_playlist.nix (limited to 'makefu') diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix index 53723299..6b2867c2 100644 --- a/makefu/2configs/ham/default.nix +++ b/makefu/2configs/ham/default.nix @@ -14,6 +14,7 @@ let #flurlicht = import ./multi/flurlicht.nix; kurzzeitwecker = import ./multi/kurzzeitwecker.nix; firetv_restart = import ./multi/firetv_restart.nix; + the_playlist = import ./multi/the_playlist.nix; # switch # automation # binary_sensor @@ -131,6 +132,7 @@ in { # https://www.home-assistant.io/cookbook/automation_for_rainy_days/ ] ++ ((import ./sensor/outside.nix) {inherit lib;}) + ++ the_playlist.sensor ++ zigbee.sensor ; frontend = { }; # light = flurlicht.light; diff --git a/makefu/2configs/ham/multi/the_playlist.nix b/makefu/2configs/ham/multi/the_playlist.nix new file mode 100644 index 00000000..aa5ce85d --- /dev/null +++ b/makefu/2configs/ham/multi/the_playlist.nix @@ -0,0 +1,26 @@ +{ + sensor = [ + { platform = "rest"; + name = "pl"; + resource = "http://prism.r:8001/current"; + scan_interval = 30; + json_attributes = [ "name" "filename" "youtube" ]; + } + { platform = "template"; + sensors = { + the_playlist_song = { + friendly_name = "Current Song"; + value_template = ''{{ states.sensor.pl.attributes['name'] }}''; + }; + the_playlist_url = { + friendly_name = "Song Youtube URL"; + value_template = ''{{ states.sensor.pl.attributes['youtube'] }}''; + }; + the_playlist_filename = { + friendly_name = "Song Filename"; + value_template = ''{{ states.sensor.pl.attributes['filename'] }}''; + }; + }; + } + ]; +} -- cgit v1.2.3 From facef9b812de753d50ae1509ae7afcd522504aec Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 22 Apr 2020 00:11:18 +0200 Subject: ma tests: add dummy ebk-notify --- makefu/0tests/data/secrets/ebk-notify.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 makefu/0tests/data/secrets/ebk-notify.yml (limited to 'makefu') diff --git a/makefu/0tests/data/secrets/ebk-notify.yml b/makefu/0tests/data/secrets/ebk-notify.yml new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3