From ae8dede5f875042eba73f0035f20defb55cfc97f Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Nov 2019 23:01:37 +0100 Subject: ma bureautomation: add frosch,daily-standup --- makefu/2configs/bureautomation/default.nix | 84 +++++++++++++--------- .../2configs/bureautomation/multi/10h_timers.nix | 4 +- .../bureautomation/multi/daily-standup.nix | 54 ++++++++++++++ makefu/2configs/bureautomation/multi/frosch.nix | 2 +- 4 files changed, 107 insertions(+), 37 deletions(-) create mode 100644 makefu/2configs/bureautomation/multi/daily-standup.nix diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index e07e0ddf..c55bc1d1 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -4,7 +4,9 @@ let ten_hours = import ./multi/10h_timers.nix { inherit lib; }; # provides: timer automation script mittagessen = import ./multi/mittagessen.nix { inherit lib; }; # provides: automation script matrix = import ./multi/matrix.nix { inherit lib; }; # provides: matrix automation - aramark = import ./multi/aramark.nix { inherit lib; }; # provides: pommes sensor + frosch = import ./multi/frosch.nix { inherit lib; }; # provides: sensor binary_sensor switch light script automation + aramark = import ./multi/aramark.nix { inherit lib; }; # provides: sensor binary_sensor + standup = import ./multi/daily-standup.nix { inherit lib; }; # provides: automation script in { imports = [ ./ota.nix @@ -88,10 +90,12 @@ in { retain = true; }; }; - switch = (import ./switch/tasmota_switch.nix) ++ - (import ./switch/rfbridge.nix); - light = (import ./light/statuslight.nix) ++ - (import ./light/buzzer.nix); + switch = (import ./switch/tasmota_switch.nix) + ++ frosch.switch + ++ (import ./switch/rfbridge.nix); + light = (import ./light/statuslight.nix) + ++ (import ./light/buzzer.nix) + ++ frosch.light; timer = ten_hours.timer; notify = [ { @@ -117,31 +121,34 @@ in { ]; script = lib.fold lib.recursiveUpdate {} [ ((import ./script/multi_blink.nix) {inherit lib;}) + frosch.script ten_hours.script mittagessen.script + standup.script ]; binary_sensor = - (import ./binary_sensor/buttons.nix) ++ - (import ./binary_sensor/motion.nix) ++ - aramark.binary_sensor; + (import ./binary_sensor/buttons.nix) + ++ (import ./binary_sensor/motion.nix) + ++ frosch.binary_sensor + ++ aramark.binary_sensor; sensor = # [{ platform = "version"; }] ++ # pyhaversion - (import ./sensor/pollen.nix) ++ - (import ./sensor/espeasy.nix) ++ - (import ./sensor/airquality.nix) ++ - ((import ./sensor/outside.nix) {inherit lib;}) ++ - (import ./sensor/influxdb.nix) ++ - (import ./sensor/tasmota_firmware.nix) ++ - aramark.sensor; + (import ./sensor/pollen.nix) + ++ (import ./sensor/espeasy.nix) + ++ (import ./sensor/airquality.nix) + ++ ((import ./sensor/outside.nix) {inherit lib;}) + ++ (import ./sensor/influxdb.nix) + ++ (import ./sensor/tasmota_firmware.nix) + ++ frosch.sensor + ++ aramark.sensor; camera = (import ./camera/verkehrskamera.nix) ++ (import ./camera/comic.nix); - # not yet released - #person = - # (import ./person/team.nix ); + person = + (import ./person/team.nix ); frontend = { }; http = { @@ -196,13 +203,22 @@ in { "light.buslicht" ]; team = [ - "device_tracker.thorsten_phone" - "device_tracker.felix_phone" - "device_tracker.ecki_tablet" - "device_tracker.daniel_phone" - "device_tracker.carsten_phone" - "device_tracker.thierry_phone" - "device_tracker.frank_phone" + "person.thorsten" + #"device_tracker.thorsten_phone" + "person.felix" + "person.ecki" + "person.daniel" + # "person.carsten" + "person.thierry" + "person.frank" + "person.emeka" + #"device_tracker.felix_phone" + #"device_tracker.ecki_tablet" + #"device_tracker.daniel_phone" + #"device_tracker.carsten_phone" + #"device_tracker.thierry_phone" + #"device_tracker.frank_phone" + #"device_tracker.emeka_phone" # "person.thorsten" # "person.felix" # "person.ecki" @@ -237,8 +253,6 @@ in { ]; sensors = [ "media_player.kodi" - "script.blitz_10s" - "script.buzz_red_led_fast" "timer.felix_10h" "timer.frank_10h" "sensor.easy2_dht22_humidity" @@ -262,13 +276,15 @@ in { # feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ]; # we don't use imports because the expressions do not merge in # home-assistant - automation = (import ./automation/bureau-shutdown.nix) ++ - (import ./automation/nachtlicht.nix) ++ - (import ./automation/schlechteluft.nix) ++ - (import ./automation/hass-restart.nix) ++ - ten_hours.automation ++ - matrix.automation ++ - mittagessen.automation; + automation = (import ./automation/bureau-shutdown.nix) + ++ (import ./automation/nachtlicht.nix) + ++ (import ./automation/schlechteluft.nix) + ++ (import ./automation/hass-restart.nix) + ++ ten_hours.automation + ++ matrix.automation + ++ standup.automation + ++ frosch.automation + ++ mittagessen.automation; device_tracker = (import ./device_tracker/openwrt.nix ); }; }; diff --git a/makefu/2configs/bureautomation/multi/10h_timers.nix b/makefu/2configs/bureautomation/multi/10h_timers.nix index 8cdaa8cf..73709e73 100644 --- a/makefu/2configs/bureautomation/multi/10h_timers.nix +++ b/makefu/2configs/bureautomation/multi/10h_timers.nix @@ -122,7 +122,7 @@ let trigger = { platform = "state"; # TODO: ecki - entity_id = [ "device_tracker.${name}_phone"]; + entity_id = [ "person.${name}"]; from = "not_home"; to = "home"; }; @@ -166,7 +166,7 @@ let condition = { condition = "state"; - entity_id = "device_tracker.${name}_phone"; + entity_id = "person.${name}"; state = "home"; }; diff --git a/makefu/2configs/bureautomation/multi/daily-standup.nix b/makefu/2configs/bureautomation/multi/daily-standup.nix new file mode 100644 index 00000000..f5bd85b9 --- /dev/null +++ b/makefu/2configs/bureautomation/multi/daily-standup.nix @@ -0,0 +1,54 @@ +{ lib }: +let + random_daily_text = ''{{ [ + "Es ist so weit, es ist Standup Zeit!", + "Zehn Uhr Fünfunddreissig ist genau die richtige Zeit für ein Standup!", + "Hat jeder seine Hausaufgaben gemacht? Bitte einmal aufstehen und den Zettel nach rechts geben", + "Aufstehen zum Appell, es wird die Anwesenheit kontrolliert!", + "Hallo Kinder, wisst ihr welche Zeit es ist??? ... Genau! ... Standup Zeit!", + "Morgens, halb elf in Deutschland - das Standupchen" ] | random }}''; + +in { + script = + { "random_daily" = { + alias = "Random Daily Introduction"; + + sequence = [ + { service = "media_player.play_media"; + data = { + entity_id = "media_player.mpd"; + media_content_type = "playlist"; + media_content_id = "ansage"; + }; + } + { delay.seconds = 5; } + { service = "tts.google_say"; + entity_id = "media_player.mpd"; + data_template = { + message = random_daily_text; + language = "de"; + }; + } + ]; + }; + }; + automation = [ + { + alias = "Daily Standup"; + trigger = { + platform = "time"; + at = "10:35:00"; + }; + action = + [ + { service = "homeassistant.turn_on"; + entity_id = [ + "script.blitz_10s" + "script.random_daily" + ]; + } + ]; + + } + ]; +} diff --git a/makefu/2configs/bureautomation/multi/frosch.nix b/makefu/2configs/bureautomation/multi/frosch.nix index de93ce2b..c0e267b6 100644 --- a/makefu/2configs/bureautomation/multi/frosch.nix +++ b/makefu/2configs/bureautomation/multi/frosch.nix @@ -1,6 +1,6 @@ { lib }: +# needs: binary_sensor.pommes let - random_pommes = '' {{ [ "Nur ein Pommes Tag ist ein guter Tag", "Schaut wie schön sie fliegen, die Pommes Seifenblasen", -- cgit v1.2.3 From d40ee24dd506a8e9b1d6128208a36132eeb4e5cc Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 00:25:01 +0100 Subject: shack/node-light: bump to latest hash --- krebs/2configs/shack/node-light.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/2configs/shack/node-light.nix b/krebs/2configs/shack/node-light.nix index 38cb3b55..9e382846 100644 --- a/krebs/2configs/shack/node-light.nix +++ b/krebs/2configs/shack/node-light.nix @@ -4,8 +4,8 @@ let pkg = pkgs.callPackage ( pkgs.fetchgit { url = "https://git.shackspace.de/rz/node-light.git"; - rev = "32d8064db5172b8068f633211c8bd5688b2c8773"; - sha256 = "14jzhs7pp3hq42wq3cwqarivn1z7vcgksfzfqfc4yyh21096yi1j"; + rev = "9c3fe451897cf170fb192a2643180fdfe22388e8"; + sha256 = "1zsc38idg452r8wpcna5m3yqx0ri11bd1bw60bl0kpz96dqqnyba"; }) { mkYarnPackage = pkgs.yarn2nix-moretea.mkYarnPackage; }; home = "/var/lib/node-light"; port = "8082"; -- cgit v1.2.3 From 42694196ee104c5e6a9a1b6d4c8c8580df73af00 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 00:25:42 +0100 Subject: shack/glados: fix regression, disable influx publisher, disable archiving --- krebs/2configs/shack/glados/default.nix | 43 +++++++++++++++------------------ 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index dc345cc4..a94e2837 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -53,20 +53,24 @@ in { elevation = 303; auth_providers = [ { type = "homeassistant";} - { type = "legacy_api_password";} { type = "trusted_networks"; - # allow_bypass_login = true; + trusted_networks = [ + "127.0.0.1/32" + "10.42.0.0/16" + "::1/128" + "fd00::/8" + ]; } ]; }; # https://www.home-assistant.io/components/influxdb/ - influxdb = { - database = "hass"; - tags = { - instance = "wolf"; - source = "hass"; - }; - }; + #influxdb = { + # database = "hass"; + # tags = { + # instance = "wolf"; + # source = "hass"; + # }; + #}; mqtt = { broker = "localhost"; port = 1883; @@ -110,26 +114,19 @@ in { base_url = "http://hass.shack"; use_x_forwarded_for = true; trusted_proxies = "127.0.0.1"; - api_password = "shackit"; - trusted_networks = [ - "127.0.0.1/32" - "10.42.0.0/16" - "::1/128" - "fd00::/8" - ]; }; - conversation = {}; - history = {}; - logbook = {}; + #conversation = {}; + #history = {}; + #logbook = {}; tts = [ { platform = "google"; language = "de"; } - { platform = "picotts"; - language = "de-DE"; - } + #{ platform = "picotts"; + # language = "de-DE"; + #} ]; - recorder = {}; + #recorder = {}; sun = {}; automation = wasser.automation; -- cgit v1.2.3 From 16e1495490f11a48dab42a769fbed7dffcbbdebf Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 09:47:29 +0100 Subject: shack/glados: remove version, google -> google_translate --- krebs/2configs/shack/glados/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index a94e2837..d000af39 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -39,8 +39,6 @@ in { })).override { extraPackages = ps: with ps; [ python-forecastio jsonrpc-async jsonrpc-websocket mpd2 - (callPackage ./deps/gtts-token.nix { }) - (callPackage ./deps/pyhaversion.nix { }) ]; }; autoExtraComponents = true; @@ -99,8 +97,7 @@ in { ]; sensor = - [{ platform = "version"; }] - ++ (import ./sensors/hass.nix) + (import ./sensors/hass.nix) ++ (import ./sensors/power.nix) ++ shackopen.sensor; @@ -109,8 +106,8 @@ in { camera = []; frontend = { }; + config = { }; http = { - # TODO: https://github.com/home-assistant/home-assistant/issues/16149 base_url = "http://hass.shack"; use_x_forwarded_for = true; trusted_proxies = "127.0.0.1"; @@ -119,7 +116,7 @@ in { #history = {}; #logbook = {}; tts = [ - { platform = "google"; + { platform = "google_translate"; language = "de"; } #{ platform = "picotts"; -- cgit v1.2.3 From 07712994e0a59201a498ec1815375f80a7aca122 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 10:59:12 +0100 Subject: ma: hardware.enableAllFirmware -> hardware.enableRedistributableFirmware what could possibly go wrong?! --- makefu/1systems/darth/config.nix | 2 +- makefu/1systems/repunit/config.nix | 2 +- makefu/1systems/tsp/config.nix | 2 +- makefu/2configs/fs/cac-boot-partition.nix | 3 +-- makefu/2configs/hw/tp-x2x0.nix | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/makefu/1systems/darth/config.nix b/makefu/1systems/darth/config.nix index 046c1574..4e71d142 100644 --- a/makefu/1systems/darth/config.nix +++ b/makefu/1systems/darth/config.nix @@ -41,7 +41,7 @@ in { makefu.server.primary-itf = "enp0s25"; # krebs.hidden-ssh.enable = true; boot.kernelModules = [ "coretemp" "f71882fg" ]; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; networking = { wireless.enable = true; diff --git a/makefu/1systems/repunit/config.nix b/makefu/1systems/repunit/config.nix index 996abff0..5589cc0a 100644 --- a/makefu/1systems/repunit/config.nix +++ b/makefu/1systems/repunit/config.nix @@ -21,7 +21,7 @@ boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "virtio_pci" "virtio_blk" ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; hardware.cpu.amd.updateMicrocode = true; # networking.firewall is enabled by default diff --git a/makefu/1systems/tsp/config.nix b/makefu/1systems/tsp/config.nix index 2921e2bc..bbfaebd4 100644 --- a/makefu/1systems/tsp/config.nix +++ b/makefu/1systems/tsp/config.nix @@ -34,6 +34,6 @@ 25 ]; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; } diff --git a/makefu/2configs/fs/cac-boot-partition.nix b/makefu/2configs/fs/cac-boot-partition.nix index 3d59a25d..14480bc4 100644 --- a/makefu/2configs/fs/cac-boot-partition.nix +++ b/makefu/2configs/fs/cac-boot-partition.nix @@ -1,7 +1,6 @@ { config, lib, pkgs, ... }: # vda1 ext4 (label nixos) -> only root partition -with import ; { boot.loader.grub.enable = true; boot.loader.grub.version = 2; @@ -16,6 +15,6 @@ with import ; fsType = "ext4"; }; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; } diff --git a/makefu/2configs/hw/tp-x2x0.nix b/makefu/2configs/hw/tp-x2x0.nix index 564925db..f4578bf7 100644 --- a/makefu/2configs/hw/tp-x2x0.nix +++ b/makefu/2configs/hw/tp-x2x0.nix @@ -15,7 +15,7 @@ networking.wireless.enable = lib.mkDefault true; - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; hardware.cpu.intel.updateMicrocode = true; -- cgit v1.2.3 From ef95a336406d7b0f49051b421ac3c85bb5614103 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 11:28:54 +0100 Subject: ma pkgs.bin2iso: use mirror of original sources --- makefu/5pkgs/bin2iso/default.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/makefu/5pkgs/bin2iso/default.nix b/makefu/5pkgs/bin2iso/default.nix index 31d05fab..676fa5b8 100644 --- a/makefu/5pkgs/bin2iso/default.nix +++ b/makefu/5pkgs/bin2iso/default.nix @@ -1,19 +1,17 @@ -{ stdenv, lib, pkgs, fetchurl }: +{ stdenv, lib, pkgs, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "bin2iso"; version = "1.9b"; - _dlver = builtins.replaceStrings ["."] [""] version; - name = "${pname}-${version}"; - src = fetchurl { - url = "http://users.eastlink.ca/~doiron/${pname}/linux/${pname}${_dlver}_linux.c"; - sha256 = "0gg4hbzlm83nnbccy79dnxbwpn7lxl3fb87ka36mlclikvknm2hy"; + src = fetchFromGitHub { + owner = "einsteinx2"; + repo = "bin2iso"; + rev = "a08f6f93b833878dc009fe59da072643f06a7830"; + sha256 = "1bnhj8z7wbq2v070zkx0xal6hx37y20a068gpy95zh13vihvbgh3"; }; - unpackPhase = "true"; - buildPhase ='' - gcc -Wall -o $pname $src + gcc -Wall -o $pname $src/src/linux_macos/${pname}_v${version}_linux.c ''; installPhase = '' @@ -21,7 +19,7 @@ stdenv.mkDerivation rec { ''; meta = { - homepage = http://users.eastlink.ca/~doiron/bin2iso/ ; + homepage = https://github.com/einsteinx2/bin2iso; description = "converts bin+cue to iso"; license = lib.licenses.gpl3; }; -- cgit v1.2.3 From cb014289287ca198418fb7ce3a253c87e7adc662 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 7 Nov 2019 11:51:32 +0100 Subject: ma wbob.r: hardware.enableRedistributableFirmware --- makefu/1systems/wbob/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index 3306279b..d8cf380e 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -145,7 +145,7 @@ in { #}; # rt2870.bin wifi card, part of linux-unfree - hardware.enableAllFirmware = true; + hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; # rt2870 with nonfree creates wlp2s0 from wlp0s20u2 # not explicitly setting the interface results in wpa_supplicant to crash -- cgit v1.2.3