From 023d911e31018131e829289ccb9963d96b38403b Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Tue, 11 May 2021 21:50:03 +0200
Subject: [PATCH 01/44] ham/light_buttons: add state machine

---
 .../home/ham/automation/light_buttons.nix     | 83 +++++++++++++++----
 1 file changed, 68 insertions(+), 15 deletions(-)

diff --git a/makefu/2configs/home/ham/automation/light_buttons.nix b/makefu/2configs/home/ham/automation/light_buttons.nix
index 32d134ecc..89caf1a41 100644
--- a/makefu/2configs/home/ham/automation/light_buttons.nix
+++ b/makefu/2configs/home/ham/automation/light_buttons.nix
@@ -1,22 +1,77 @@
-# light.wohnzimmerbeleuchtung
-# light.wohnzimmer_deko
-# light.arbeitszimmerbeleuchtung
-# light.arbeitszimmer_deko
-# light.schlafzimmerbeleuchtung
 
 let
-  toggle = light: btn:
+  btn_state = light: btn: halfbright:
+  let
+    maxbright = 255;
+    transition = 0.2; # seconds
+  in
+  # this function implements a simple state machine based on the state and brightness of the light (light must support brightness
   {
-    alias = "Toggle Light ${light} via ${btn}";
+    alias = "Cycle through states of ${light} via button ${btn}";
     trigger = {
       platform = "state";
       entity_id = "sensor.${btn}_click";
       to = "single";
     };
     action = {
-      service = "light.toggle";
-      data.entity_id = light;
-      data.transition = 0;
+      choose = [
+        {
+          # state 0: off to half
+          conditions = {
+            condition = "template";
+            value_template = ''{{ states("${light}")  == "off" }}'';
+          };
+          sequence = [
+            {
+              service = "light.turn_on";
+              data = {
+                entity_id = light;
+                brightness = halfbright;
+              };
+            }
+          ];
+        }
+        {
+          # state 1: half to full
+          conditions = {
+            condition = "template";
+            value_template = ''{{ states('${light}')  == 'on' and ( ${toString (halfbright - 1)} <= state_attr("${light}","brightness") <= ${toString (halfbright + 1)})}}'';
+          };
+          sequence = [
+            {
+              service = "light.turn_on";
+              data = {
+                entity_id = light;
+                brightness = maxbright;
+              };
+            }
+          ];
+        }
+        {
+          # state 2: full to off
+          conditions =  {
+            condition = "template";
+            # TODO: it seems like the devices respond with brightness-1 , maybe off-by-one somewhere?
+            value_template = ''{{ states("${light}")  == "on" and state_attr("${light}","brightness") >= ${toString (maxbright - 1)}}}'';
+          };
+          sequence = [
+            {
+              service = "light.turn_off";
+              data = {
+                entity_id = light;
+              };
+            }
+          ];
+        }
+      ];
+      # default: on to off
+      # this works because state 0 checks for "state == off"
+      default = [{
+        service = "light.turn_off";
+        data = {
+          entity_id = light;
+        };
+      }];
     };
   };
   turn_off_all = btn:
@@ -34,11 +89,9 @@ let
   };
 in {
   services.home-assistant.config.automation = [
-    (toggle "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1")
-    (toggle "light.schlafzimmerbeleuchtung" "schlafzimmer_btn2")
-    (toggle "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3")
-    (turn_off_all "arbeitszimmer_btn1")
+    # (btn_state "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1")
+    (btn_state "light.schlafzimmer_komode_osram" "schlafzimmer_btn2" 128)
+    # (btn_state "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3")
     (turn_off_all "schlafzimmer_btn2")
-    (turn_off_all "wohnzimmer_btn3")
   ];
 }

From b4a2d61f38824a43a87b63f145f9a41ec0db1073 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Fri, 14 May 2021 23:53:59 +0200
Subject: [PATCH 02/44] ma awesomecfg: fix issue with windows popping up at the
 wrong screen

---
 makefu/5pkgs/awesomecfg/default.nix |  1 -
 makefu/5pkgs/awesomecfg/full.cfg    | 19 ++-----------------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/makefu/5pkgs/awesomecfg/default.nix b/makefu/5pkgs/awesomecfg/default.nix
index 7a4d30137..8552634ff 100644
--- a/makefu/5pkgs/awesomecfg/default.nix
+++ b/makefu/5pkgs/awesomecfg/default.nix
@@ -16,7 +16,6 @@
   full = lib.makeOverridable pkgs.substituteAll {
     name = "awesome_full_config";
     inherit alsaUtils locker xbacklight modkey networkmanagerapplet blueman clipit flameshot ;
-    chaptermarker = chapter-marker;
     isExecutable = false;
     src = ./full.cfg;
   };
diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg
index 86b401cfa..bbf15e603 100644
--- a/makefu/5pkgs/awesomecfg/full.cfg
+++ b/makefu/5pkgs/awesomecfg/full.cfg
@@ -303,16 +303,6 @@ globalkeys = awful.util.table.join(
     awful.key({ modkey,           }, "Right",  awful.tag.viewnext       ),
     awful.key({ modkey,           }, "Escape", awful.tag.history.restore),
 
-    awful.key({ modkey,           }, "j",
-        function ()
-            awful.client.focus.byidx( 1)
-            if client.focus then client.focus:raise() end
-        end),
-    awful.key({ modkey,           }, "k",
-        function ()
-            awful.client.focus.byidx(-1)
-            if client.focus then client.focus:raise() end
-        end),
     awful.key({ modkey,           }, "w", function () mymainmenu:show() end),
 
     -- Layout manipulation
@@ -376,12 +366,6 @@ globalkeys = awful.util.table.join(
     awful.key({ }, "XF86AudioMute", function ()
         awful.util.spawn("@alsaUtils@/bin/amixer -q -D default sset Master toggle", false) end),
 
-    -- chapter-marker
-    awful.key({ "Control" }, "u", function () awful.spawn("@chaptermarker@/bin/chapter-start") end,
-              {description = "start the chapter marker",}),
-    awful.key({ "Control" }, "j", function () awful.spawn("@chaptermarker@/bin/chapter-mark") end,
-              {description = "create a chapter mark",}),
-
     -- Prompt
     awful.key({ modkey },            "r",     function () awful.screen.focused().mypromptbox:run() end,
               {description = "run prompt", group = "launcher"}),
@@ -485,12 +469,13 @@ root.keys(globalkeys)
 
 -- {{{ Rules
 awful.rules.rules = {
-    -- All clients will match this rule.
+--    -- All clients will match this rule.
     { rule = { },
       properties = { border_width = beautiful.border_width,
                      border_color = beautiful.border_normal,
                      focus = awful.client.focus.filter,
                      keys = clientkeys,
+                     screen = awful.screen.focused,
                      buttons = clientbuttons } },
     --{ rule = { class = "MPlayer" },
     --  properties = { floating = true } },

From f8763674758d50b4ca9042eed218f02819400d63 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Tue, 23 Mar 2021 22:50:53 +0100
Subject: [PATCH 03/44] krops: 1.24.1 -> 1.25.0

---
 submodules/krops | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/submodules/krops b/submodules/krops
index c2fa48550..cccebf3ff 160000
--- a/submodules/krops
+++ b/submodules/krops
@@ -1 +1 @@
-Subproject commit c2fa48550f2bb46009b9cecdb9ac838dc402ce19
+Subproject commit cccebf3ff7a53336b3f106cb96dddd5892d427ed

From 41cee167f6854b6879aa931e668cc80331d7acb0 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Tue, 20 Apr 2021 22:01:35 +0200
Subject: [PATCH 04/44] l: searx init at 1.0.0

---
 lass/5pkgs/searx/default.nix | 69 ++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 lass/5pkgs/searx/default.nix

diff --git a/lass/5pkgs/searx/default.nix b/lass/5pkgs/searx/default.nix
new file mode 100644
index 000000000..e5ce5788a
--- /dev/null
+++ b/lass/5pkgs/searx/default.nix
@@ -0,0 +1,69 @@
+{ lib, nixosTests, python3, python3Packages, fetchFromGitHub, fetchpatch }:
+
+with python3Packages;
+
+toPythonModule (buildPythonApplication rec {
+  pname = "searx";
+  version = "1.0.0";
+
+  # Can not use PyPI because certain test files are missing.
+  src = fetchFromGitHub {
+    owner = "searx";
+    repo = "searx";
+    rev = "v${version}";
+    sha256 = "0ghkx8g8jnh8yd46p4mlbjn2zm12nx27v7qflr4c8xhlgi0px0mh";
+  };
+
+  postPatch = ''
+    sed -i 's/==.*$//' requirements.txt
+  '';
+
+  preBuild = ''
+    export SEARX_DEBUG="true";
+  '';
+
+  propagatedBuildInputs = [
+    Babel
+    certifi
+    dateutil
+    flask
+    flaskbabel
+    gevent
+    grequests
+    jinja2
+    langdetect
+    lxml
+    ndg-httpsclient
+    pyasn1
+    pyasn1-modules
+    pygments
+    pysocks
+    pytz
+    pyyaml
+    requests
+    speaklater
+    werkzeug
+  ];
+
+  # tests try to connect to network
+  doCheck = false;
+  # checkInputs = [
+  #   Babel mock nose2 covCore pep8 plone-testing splinter
+  #   unittest2 zope_testrunner selenium
+  # ];
+
+  postInstall = ''
+    # Create a symlink for easier access to static data
+    mkdir -p $out/share
+    ln -s ../${python3.sitePackages}/searx/static $out/share/
+  '';
+
+  passthru.tests = { inherit (nixosTests) searx; };
+
+  meta = with lib; {
+    homepage = "https://github.com/searx/searx";
+    description = "A privacy-respecting, hackable metasearch engine";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ matejc fpletz globin danielfullmer ];
+  };
+})

From 90bea335fd5edb15771df002468d0b5c50c472df Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Sun, 25 Apr 2021 17:34:23 +0200
Subject: [PATCH 05/44] go: store urls in redis

---
 krebs/3modules/go.nix | 48 +++++++++++++------------------------------
 1 file changed, 14 insertions(+), 34 deletions(-)

diff --git a/krebs/3modules/go.nix b/krebs/3modules/go.nix
index 4df73509c..5686fea3f 100644
--- a/krebs/3modules/go.nix
+++ b/krebs/3modules/go.nix
@@ -20,61 +20,41 @@ let
   };
 
   imp = {
+    services.redis = {
+      enable = true;
+    };
+
     krebs.htgen.go = {
       port = cfg.port;
       script = ''. ${pkgs.writeDash "go" ''
-        find_item() {
-          if test ''${#1} -ge 7; then
-            set -- "$(find "$STATEDIR/items" -mindepth 1 -maxdepth 1 \
-                -regex "$STATEDIR/items/$1[0-9A-Za-z]*$")"
-            if test -n "$1" && test $(echo "$1" | wc -l) = 1; then
-              echo "$1"
-              return 0
-            fi
-          fi
-          return 1
-        }
-
-        STATEDIR=$HOME
-        mkdir -p "$STATEDIR/items"
+        set -x
 
         case "$Method $Request_URI" in
           "GET /"*)
-            if item=$(find_item "''${Request_URI#/}"); then
-              uri=$(cat "$item")
+            if item=$(${pkgs.redis}/bin/redis-cli --raw get "''${Request_URI#/}"); then
               printf 'HTTP/1.1 302 Found\r\n'
               printf 'Content-Type: text/plain\r\n'
               printf 'Connection: closed\r\n'
-              printf 'Location: %s\r\n' "$uri"
+              printf 'Location: %s\r\n' "$item"
               printf '\r\n'
               exit
             fi
           ;;
           "POST /")
-            uri=$(mktemp -t htgen.$$.content.XXXXXXXX)
-            trap 'rm $uri >&2' EXIT
-
-            head -c "$req_content_length" \
+            uri=$(head -c "$req_content_length" \
               | sed 's/+/ /g;s/%\(..\)/\\x\1/g;' \
               | xargs -0 echo -e \
               | tee /tmp/tee.log \
               | ${pkgs.urix}/bin/urix \
               | head -1 \
-              > "$uri"
-            sha256=$(sha256sum -b "$uri" | cut -d\  -f1)
+            )
+
+            sha256=$(echo "$uri" | sha256sum -b | cut -d\  -f1)
             base32=$(${pkgs.nixStable}/bin/nix-hash --to-base32 --type sha256 "$sha256")
-            item="$STATEDIR/items/$base32"
-            ref="http://$req_host/$base32"
+            base32short=$(echo "$base32" | cut -b-5)
+            ${pkgs.redis}/bin/redis-cli set "$base32short" "$uri" >/dev/null
 
-            if ! test -e "$item"; then
-              mkdir -v -p "$STATEDIR/items" >&2
-              cp -v "$uri" "$item" >&2
-            fi
-
-            base32short=$(echo "$base32" | cut -b-7)
-            if item=$(find_item "$base32short"); then
-              ref="http://$req_host/$base32short"
-            fi
+            ref="http://$req_host/$base32short"
 
             printf 'HTTP/1.1 200 OK\r\n'
             printf 'Content-Type: text/plain; charset=UTF-8\r\n'

From 6674b6c0a98e3dbf212d5c36e6f6d7f17a4d5df5 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Tue, 27 Apr 2021 21:40:35 +0200
Subject: [PATCH 06/44] realwallpaper: move pkgs into export

---
 krebs/3modules/realwallpaper.nix             |  9 --------
 krebs/5pkgs/simple/realwallpaper/default.nix | 23 ++++++++++++++++----
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/krebs/3modules/realwallpaper.nix b/krebs/3modules/realwallpaper.nix
index cfa8a65ba..86b74a8ca 100644
--- a/krebs/3modules/realwallpaper.nix
+++ b/krebs/3modules/realwallpaper.nix
@@ -42,15 +42,6 @@ let
       description = "real wallpaper generator";
       after = [ "network.target" ];
 
-      path = with pkgs; [
-        xplanet
-        imagemagick
-        inkscape
-        curl
-        file
-        jq
-      ];
-
       environment = {
         working_dir = cfg.workingDir;
         marker_url = cfg.marker;
diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix
index 04a2a6718..aafabb7b6 100644
--- a/krebs/5pkgs/simple/realwallpaper/default.nix
+++ b/krebs/5pkgs/simple/realwallpaper/default.nix
@@ -1,6 +1,21 @@
 { pkgs, ... }:
 pkgs.writers.writeDashBin "generate-wallpaper" ''
-  set -euf
+  set -xeuf
+
+  export PATH=${with pkgs; lib.makeBinPath [
+    coreutils
+    curl
+    gnugrep
+    gnused
+    file
+    findutils
+    grib2json
+    imagemagick
+    inkscape
+    jq
+    nomads-cloud
+    xplanet
+  ]}
 
   # usage: getimg FILENAME URL
   fetch() {
@@ -118,7 +133,7 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
 
     # fetch clouds if they are older than 3h
     if ! test "$(find clouds-raw.png -mmin -180)"; then
-      ${pkgs.nomads-cloud}/bin/nomads-cloud clouds-raw.png
+      nomads-cloud clouds-raw.png
     fi
 
     in_size=3600x1800
@@ -161,14 +176,14 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
     fi
 
     if needs_rebuild krebs.png krebs-raw.svg; then
-      inkscape -z -e krebs.png -w 16 -h 16 krebs-raw.svg
+      inkscape --export-type="png" --export-width=16 --export-height=16 --export-filename=krebs.png krebs-raw.svg
     fi
 
     # -- Planets --
     for planet in mercury venus mars jupiter saturn uranus neptune; do
       if needs_rebuild "$planet".png "$planet"-raw.svg; then
         sed -i 's/#000/#FE8019/g' "$planet"-raw.svg
-        inkscape -z -e "$planet".png -w 40 -h 40 "$planet"-raw.svg
+        inkscape --export-type="png" --export-width=40 --export-height=40 --export-filename="$planet.png" "$planet-raw.svg"
       fi
     done
 

From 329d01a7bfc592edaf790e40b3a58d4ffac982b8 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Tue, 27 Apr 2021 21:43:18 +0200
Subject: [PATCH 07/44] nomads-cloud: fix url

---
 krebs/5pkgs/simple/nomads-cloud/default.nix | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/krebs/5pkgs/simple/nomads-cloud/default.nix b/krebs/5pkgs/simple/nomads-cloud/default.nix
index 6e4ace484..97cf10d1f 100644
--- a/krebs/5pkgs/simple/nomads-cloud/default.nix
+++ b/krebs/5pkgs/simple/nomads-cloud/default.nix
@@ -10,7 +10,8 @@ writers.writeDashBin "nomads-cloud" ''
 
   date=$(${coreutils}/bin/date +%Y%m%d)
   for hour in 18 12 06 00; do
-    url="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25_1hr.pl?file=gfs.t''${hour}z.pgrb2.0p25.anl&lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29=on&var_CWAT=on&leftlon=-180&rightlon=180&toplat=90&bottomlat=-90&dir=%2Fgfs.$date%2F$hour"
+    url="https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25_1hr.pl?file=gfs.t''${hour}z.pgrb2.0p25.anl&lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29=on&var_CWAT=on&leftlon=-180&rightlon=180&toplat=90&bottomlat=-90&dir=%2Fgfs.''${date}%2F''${hour}%2Fatmos"
+    echo "$url"
     ${curl}/bin/curl -fsS "$url" > "$grib_path"
     if [ "$?" -eq 0 ]; then
       break

From 4f638ddb3da099e02ef8c5444026f0e71e553741 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Fri, 30 Apr 2021 11:29:24 +0200
Subject: [PATCH 08/44] go: use last 5 hash characters for short urls

---
 krebs/3modules/go.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/krebs/3modules/go.nix b/krebs/3modules/go.nix
index 5686fea3f..fea25e036 100644
--- a/krebs/3modules/go.nix
+++ b/krebs/3modules/go.nix
@@ -51,7 +51,7 @@ let
 
             sha256=$(echo "$uri" | sha256sum -b | cut -d\  -f1)
             base32=$(${pkgs.nixStable}/bin/nix-hash --to-base32 --type sha256 "$sha256")
-            base32short=$(echo "$base32" | cut -b-5)
+            base32short=$(echo "$base32" | cut -c48-52)
             ${pkgs.redis}/bin/redis-cli set "$base32short" "$uri" >/dev/null
 
             ref="http://$req_host/$base32short"

From 714eaee3d0d79cd1b0d9243fc4bea64518b22af4 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Sun, 2 May 2021 17:37:10 +0200
Subject: [PATCH 09/44] realwallpaper: add version with star constellations

---
 krebs/5pkgs/simple/realwallpaper/default.nix  | 33 ++++++++++++++++-
 .../realwallpaper/get_constellations.py       | 36 +++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 krebs/5pkgs/simple/realwallpaper/get_constellations.py

diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix
index aafabb7b6..c9b2e76b6 100644
--- a/krebs/5pkgs/simple/realwallpaper/default.nix
+++ b/krebs/5pkgs/simple/realwallpaper/default.nix
@@ -271,6 +271,32 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
         shade=15
       ''}
 
+    ${pkgs.writers.writePython3 "get_constellations" {
+      libraries = [ pkgs.python3Packages.astropy ];
+    } ./get_constellations.py} ${pkgs.fetchurl {
+      url = "https://raw.githubusercontent.com/ofrohn/d3-celestial/d2e20e104b86429d90ac8227a5b021262b45d75a/data/constellations.lines.json";
+      sha256 = "0g71fdrnxvxd6pcqvihj2q9iaynrl7px45kzw6qm1kymynz6ckr9";
+    }} > constellations.arcs
+
+    xplanet --num_times 1 --geometry $xplanet_out_size \
+      --output xplanet-krebs-stars-output.png --projection merc \
+      -config ${pkgs.writeText "xplanet-krebs-stars.config" ''
+        [default]
+
+        arc_thickness=1
+        arc_file=constellations.arcs
+
+        [earth]
+        "Earth"
+        map=daymap-final.png
+        night_map=nightmap-final.png
+        cloud_map=clouds.png
+        cloud_threshold=1
+        cloud_gamma=10
+        marker_file=marker_file
+        shade=15
+      ''}
+
     # trim xplanet output
     if needs_rebuild realwallpaper.png xplanet-output.png; then
       convert xplanet-output.png -crop $out_geometry \
@@ -278,7 +304,6 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
         mv realwallpaper-tmp.png realwallpaper.png
     fi
 
-    # trim xplanet output
     if needs_rebuild realwallpaper-marker.png xplanet-marker-output.png; then
       convert xplanet-marker-output.png -crop $out_geometry \
         realwallpaper-marker-tmp.png
@@ -292,6 +317,12 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
         mkdir -p archive
         convert realwallpaper-krebs.png archive/"$(date -Is)".jpg
     fi
+
+    if needs_rebuild realwallpaper-krebs-stars.png xplanet-krebs-stars-output.png; then
+      convert xplanet-krebs-stars-output.png -crop $out_geometry \
+        realwallpaper-krebs-stars-tmp.png
+        mv realwallpaper-krebs-stars-tmp.png realwallpaper-krebs-stars.png
+    fi
   }
 
   main "$@"
diff --git a/krebs/5pkgs/simple/realwallpaper/get_constellations.py b/krebs/5pkgs/simple/realwallpaper/get_constellations.py
new file mode 100644
index 000000000..5d8d3df5d
--- /dev/null
+++ b/krebs/5pkgs/simple/realwallpaper/get_constellations.py
@@ -0,0 +1,36 @@
+from astropy.coordinates import SkyCoord, ITRS, representation
+from astropy.time import Time
+import json
+import sys
+
+
+def convert_to_itrs(coord):
+    c = SkyCoord(coord[0], coord[1], unit='degree', frame='icrs')
+    c_itrs = c.transform_to(ITRS(obstime=Time.now()))
+    rep = c_itrs.represent_as(representation.UnitSphericalRepresentation)
+    return [rep.lat.deg, rep.lon.deg]
+
+
+def points_to_lines(points):
+    lines = []
+    for x in range(len(points) - 1):
+        lines.append([points[x], points[x+1]])
+    return lines
+
+
+with open(sys.argv[1]) as f:
+    constellations = json.load(f)['features']
+
+output = []
+
+for const in constellations:
+    for line in const['geometry']['coordinates']:
+        transformed_line = []
+        for point in line:
+            transformed_line.append(convert_to_itrs(point))
+
+        line_combined = points_to_lines(transformed_line)
+        for l in line_combined:  # noqa
+            output.append(f'{l[0][0]} {l[0][1]} {l[1][0]} {l[1][1]} # {const["id"]}')  # noqa
+
+print('\n'.join(output))

From 8d19145cee3effd1ea55c586bf4bb97ee3fe3f73 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Sun, 2 May 2021 17:40:21 +0200
Subject: [PATCH 10/44] l realwallpaper: serve krebs-stars

---
 lass/2configs/realwallpaper.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lass/2configs/realwallpaper.nix b/lass/2configs/realwallpaper.nix
index 7a2f6e916..c873ae4d5 100644
--- a/lass/2configs/realwallpaper.nix
+++ b/lass/2configs/realwallpaper.nix
@@ -28,6 +28,9 @@ in {
     locations."/realwallpaper-krebs.png".extraConfig = ''
       root /var/realwallpaper/;
     '';
+    locations."/realwallpaper-krebs-stars.png".extraConfig = ''
+      root /var/realwallpaper/;
+    '';
     locations."/realwallpaper-video.mp4".extraConfig = ''
       root /var/realwallpaper/archive;
     '';

From 6766e04b9a952e69f55f7af1adc5adffe5c2230a Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Sun, 2 May 2021 17:48:27 +0200
Subject: [PATCH 11/44] l fetchWallpaper: use stars version

---
 lass/2configs/fetchWallpaper.nix | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lass/2configs/fetchWallpaper.nix b/lass/2configs/fetchWallpaper.nix
index 065ee9c42..251f886a9 100644
--- a/lass/2configs/fetchWallpaper.nix
+++ b/lass/2configs/fetchWallpaper.nix
@@ -5,8 +5,7 @@ let
 in {
   krebs.fetchWallpaper = {
     enable = true;
-    unitConfig.ConditionPathExists = "!/var/run/ppp0.pid";
-    url = "prism/realwallpaper-krebs.png";
+    url = "prism/realwallpaper-krebs-stars.png";
   };
 }
 

From bbe60be64d2647002be6b70c8dc92421d48cb0de Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Sun, 2 May 2021 19:09:47 +0200
Subject: [PATCH 12/44] realwallpaper: add krebs-stars-berlin version

---
 krebs/5pkgs/simple/realwallpaper/default.nix | 26 ++++++++++++++++++++
 lass/2configs/realwallpaper.nix              |  3 +++
 2 files changed, 29 insertions(+)

diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix
index c9b2e76b6..8728c0ae7 100644
--- a/krebs/5pkgs/simple/realwallpaper/default.nix
+++ b/krebs/5pkgs/simple/realwallpaper/default.nix
@@ -297,6 +297,26 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
         shade=15
       ''}
 
+    xplanet --num_times 1 --geometry $xplanet_out_size \
+      --latitude 52.520008 --longitude 13.404954 \
+      --output xplanet-krebs-stars-berlin-output.png --projection merc \
+      -config ${pkgs.writeText "xplanet-krebs-stars.config" ''
+        [default]
+
+        arc_thickness=1
+        arc_file=constellations.arcs
+
+        [earth]
+        "Earth"
+        map=daymap-final.png
+        night_map=nightmap-final.png
+        cloud_map=clouds.png
+        cloud_threshold=1
+        cloud_gamma=10
+        marker_file=marker_file
+        shade=15
+      ''}
+
     # trim xplanet output
     if needs_rebuild realwallpaper.png xplanet-output.png; then
       convert xplanet-output.png -crop $out_geometry \
@@ -323,6 +343,12 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
         realwallpaper-krebs-stars-tmp.png
         mv realwallpaper-krebs-stars-tmp.png realwallpaper-krebs-stars.png
     fi
+
+    if needs_rebuild realwallpaper-krebs-stars-berlin.png xplanet-krebs-stars-berlin-output.png; then
+      convert xplanet-krebs-stars-berlin-output.png -crop $out_geometry \
+        realwallpaper-krebs-stars-berlin-tmp.png
+        mv realwallpaper-krebs-stars-berlin-tmp.png realwallpaper-krebs-stars-berlin.png
+    fi
   }
 
   main "$@"
diff --git a/lass/2configs/realwallpaper.nix b/lass/2configs/realwallpaper.nix
index c873ae4d5..0bae91d89 100644
--- a/lass/2configs/realwallpaper.nix
+++ b/lass/2configs/realwallpaper.nix
@@ -31,6 +31,9 @@ in {
     locations."/realwallpaper-krebs-stars.png".extraConfig = ''
       root /var/realwallpaper/;
     '';
+    locations."/realwallpaper-krebs-stars-berlin.png".extraConfig = ''
+      root /var/realwallpaper/;
+    '';
     locations."/realwallpaper-video.mp4".extraConfig = ''
       root /var/realwallpaper/archive;
     '';

From c65950414676f27a3a1edfd3e24b1e4565ecef8c Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Mon, 3 May 2021 17:59:52 +0200
Subject: [PATCH 13/44] l: (re)init echelon.r (with ssh tor unlocking)

---
 krebs/3modules/lass/default.nix               | 40 +++++++++++++++
 lass/1systems/echelon/config.nix              | 14 ++++++
 lass/1systems/echelon/physical.nix            | 33 +++++++++++++
 .../dummy-secrets/initrd/ssh.ed25519_key      |  0
 lass/2configs/tor-initrd.nix                  | 49 +++++++++++++++++++
 5 files changed, 136 insertions(+)
 create mode 100644 lass/1systems/echelon/config.nix
 create mode 100644 lass/1systems/echelon/physical.nix
 create mode 100644 lass/2configs/tests/dummy-secrets/initrd/ssh.ed25519_key
 create mode 100644 lass/2configs/tor-initrd.nix

diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix
index 300ea2ccc..d29988be2 100644
--- a/krebs/3modules/lass/default.nix
+++ b/krebs/3modules/lass/default.nix
@@ -742,6 +742,46 @@ in {
       syncthing.id = "W5BJ4TL-GAQ46WS-ZB72HFS-XOURLBA-RNBVMYC-POFH4UA-CBORQID-BMIHNQZ";
     };
 
+    echelon = {
+      cores = 1;
+      nets = {
+        retiolum = {
+          ip4.addr = "10.243.0.3";
+          ip6.addr = r6 "4";
+          aliases = [
+            "echelon.r"
+          ];
+          tinc.pubkey = ''
+            -----BEGIN PUBLIC KEY-----
+            MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEArxTpl0YvJWiF9cAYeAdp
+            1gG18vrSeYDpmVCsZmxi2qyeWNM4JGSVPYoagyKHSDGH60xvktRh/1Zat+1hHR0A
+            MAjDIENn9hAICQ8lafnm2v3+xzLNoTMJTYG3eba2MlJpAH0rYP0E5xBhQj9DCSAe
+            UpEZWAwCKDCOmg/9h0gvs3kh0HopwjOE1IEzApgg05Yuhna96IATVdBAC7uF768V
+            rJZNkQRvhetGxB459C58uMdcRK3degU6HMpZIXjJk6bqkzKBMm7C3lsAfaWulfez
+            gavFSHC15NbHkz+fcVZNZReJhfTHP7k05xo5vYpDhszdUSjc3MtWBmk5v9zdS1pO
+            c+20a1eurr1EPoYBqjQL0tLBwuQc2tN5XqJKVY5LGAnojAI6ktPKPLR6qZHC4Kna
+            dgJ/S1BzHVxniYh3/rEzhXioneZ6oZgO+65WtsS42WAvh/53U/Q3chgI074Jssze
+            ev09+zU8Xj0vX/7KpRKy5Vln6RGkQbKAIt7TZL5cJALswQDzcCO4WTv1X5KoG3+D
+            KfTMfl9HzFsv59uHKlUqUguN5e8CLdmjgU1v2WvHBCw1PArIE8ZC0Tu2bMi5i9Vq
+            GHxVn9O4Et5yPocyQtE4zOfGfqwR/yNa//Zs1b6DxQ73tq7rbBQaAzq7lxW6Ndbr
+            43jjLL40ONdFxX7qW/DhT9MCAwEAAQ==
+            -----END PUBLIC KEY-----
+          '';
+        };
+        wiregrill = {
+          ip6.addr = w6 "3";
+          aliases = [
+            "echelon.w"
+          ];
+          wireguard.pubkey = ''
+            SLdk0lph2rSFU+3dyrWDU1CT/oU+HPcOVYeGVIgDpEc=
+          '';
+        };
+      };
+      ssh.privkey.path = <secrets/ssh.id_ed25519>;
+      ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIn+o0uCBSot254kZKlNepVKFcwDPdr8s6+lQmYGM3Hd ";
+    };
+
   };
   users = rec {
     lass = lass-yubikey;
diff --git a/lass/1systems/echelon/config.nix b/lass/1systems/echelon/config.nix
new file mode 100644
index 000000000..9e72916b3
--- /dev/null
+++ b/lass/1systems/echelon/config.nix
@@ -0,0 +1,14 @@
+{ config, pkgs, ... }:
+{
+  imports = [
+    <stockholm/lass>
+
+    <stockholm/lass/2configs/retiolum.nix>
+    <stockholm/lass/2configs/tor-initrd.nix>
+  ];
+
+  krebs.build.host = config.krebs.hosts.echelon;
+
+  boot.tmpOnTmpfs = true;
+}
+
diff --git a/lass/1systems/echelon/physical.nix b/lass/1systems/echelon/physical.nix
new file mode 100644
index 000000000..fbacc3927
--- /dev/null
+++ b/lass/1systems/echelon/physical.nix
@@ -0,0 +1,33 @@
+{ config, lib, pkgs, modulesPath, ... }:
+{
+  imports = [
+    ./config.nix
+    (modulesPath + "/profiles/qemu-guest.nix")
+  ];
+
+  # Use the GRUB 2 boot loader.
+  boot.loader.grub.enable = true;
+  boot.loader.grub.version = 2;
+  boot.loader.grub.efiSupport = true;
+  boot.loader.grub.efiInstallAsRemovable = true;
+  # Define on which hard drive you want to install Grub.
+  boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
+
+  boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sd_mod" "sr_mod" ];
+  boot.initrd.kernelModules = [ "dm-snapshot" ];
+  boot.initrd.luks.devices.luksroot.device = "/dev/sda3";
+
+  networking.useDHCP = false;
+  networking.interfaces.ens18.useDHCP = true;
+
+  fileSystems."/" = {
+    device = "/dev/disk/by-uuid/5186edb1-9234-48ae-8679-61facb56b818";
+    fsType = "xfs";
+  };
+
+  fileSystems."/boot" = {
+    device = "/dev/disk/by-uuid/56D1-34A0";
+    fsType = "vfat";
+  };
+
+}
diff --git a/lass/2configs/tests/dummy-secrets/initrd/ssh.ed25519_key b/lass/2configs/tests/dummy-secrets/initrd/ssh.ed25519_key
new file mode 100644
index 000000000..e69de29bb
diff --git a/lass/2configs/tor-initrd.nix b/lass/2configs/tor-initrd.nix
new file mode 100644
index 000000000..64e64b5b3
--- /dev/null
+++ b/lass/2configs/tor-initrd.nix
@@ -0,0 +1,49 @@
+{config, pkgs, ... }:
+## unlock command:
+# (pass admin/$host/root;echo) | torify ssh root@$(pass hosts/$host/initrd/hostname) 'cat > /crypt-ramfs/passphrase'
+{
+  boot.initrd.network.enable = true;
+  boot.initrd.network.ssh = {
+    enable = true;
+    port = 22;
+    authorizedKeys = [
+      config.krebs.users.lass.pubkey
+      config.krebs.users.lass-mors.pubkey
+      config.krebs.users.lass-green.pubkey
+    ];
+    hostKeys = [ <secrets/initrd/ssh.ed25519_key> ];
+  };
+  boot.initrd.availableKernelModules = [ "e1000e" ];
+
+  boot.initrd.secrets = {
+    "/etc/tor/onion/bootup" = <secrets/initrd>;
+  };
+
+  boot.initrd.extraUtilsCommands = ''
+    copy_bin_and_libs ${pkgs.tor}/bin/tor
+  '';
+
+  # start tor during boot process
+  boot.initrd.network.postCommands = let
+    torRc = (pkgs.writeText "tor.rc" ''
+      DataDirectory /etc/tor
+      SOCKSPort 127.0.0.1:9050 IsolateDestAddr
+      SOCKSPort 127.0.0.1:9063
+      HiddenServiceDir /etc/tor/onion/bootup
+      HiddenServicePort 22 127.0.0.1:22
+    '');
+  in ''
+    echo "tor: preparing onion folder"
+    # have to do this otherwise tor does not want to start
+    chmod -R 700 /etc/tor
+
+    echo "make sure localhost is up"
+    ip a a 127.0.0.1/8 dev lo
+    ip link set lo up
+
+    echo "tor: starting tor"
+    tor -f ${torRc} --verify-config
+    tor -f ${torRc} &
+  '';
+}
+

From 2c8efec3c7275a98e96a57f1497224c8650305be Mon Sep 17 00:00:00 2001
From: rtjure <rtjure@rtjure>
Date: Tue, 4 May 2021 16:32:42 +0200
Subject: [PATCH 14/44] [PATCH] External: added public key and reference

---
 krebs/3modules/external/default.nix    | 1 +
 krebs/3modules/external/ssh/rtjure.pub | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 krebs/3modules/external/ssh/rtjure.pub

diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix
index c8e360a1e..809d5a7db 100644
--- a/krebs/3modules/external/default.nix
+++ b/krebs/3modules/external/default.nix
@@ -671,6 +671,7 @@ in {
       pubkey = ssh-for "raute";
     };
     rtjure = {
+      pubkey = ssh-for "rtjure";
     };
     sokratess = {
     };
diff --git a/krebs/3modules/external/ssh/rtjure.pub b/krebs/3modules/external/ssh/rtjure.pub
new file mode 100644
index 000000000..4c69e1836
--- /dev/null
+++ b/krebs/3modules/external/ssh/rtjure.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDVFTzk646b/XXTFyWoKLw92jLmqC3EwAURtSZkWPxcZv+OPd76cgLl2bKgEHZ1/n4784zqNM85q+pk1NJfaTNB2SMksM5p8yFdCKcrMci0mdIcjp53z0SxUU4EozUnuntfFPnvjMAG5i1ppungkala9svc6x4vHuinHSvGXDJW7YsF5vSbDppGvgji9HKN8iagPhT1gnOf4o5ZqgD9cwS/3cXZx+gcSNnEolhr1WKcglDGeMJKQoNLkfojgLw4ZE4DpNYN5CJ64adZOXun9DrhV2iYgkKurJ9CxJXSP9ULQKKMayDCJBE5XTWxgH6oyOAjurYQoYozI4/yKZXRgrIz97gHgXqh45/q64gNe9XbLXzhz4neOE77L1WYEE+sUYqXIlKwtFQHqYLuU09ZCkiKft9N0A2Lpcm0m7ebpSBd6PH8sF9hrAjtNACReTYritXF7b+LT5Zkxu98BgK36rcOnMkPpMm+svh+MiCCE4jm6HT+O2yikYSnc2q7W6ljjxs= rtjure@nxdc

From 353438170cddbeeb7cefaea3097c9ee28e8c0299 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Mon, 15 Feb 2021 19:55:25 +0100
Subject: [PATCH 15/44] mic92: add okelmann

---
 krebs/3modules/external/mic92.nix | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index 306ab34eb..baa54e9e1 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -303,6 +303,27 @@ in {
         };
       };
     };
+    okelmann = {
+      owner = config.krebs.users.mic92;
+      nets = {
+        retiolum = {
+          ip4.addr = "10.243.29.190";
+          aliases = [
+            "okelmann.r"
+          ];
+          tinc.pubkey = ''
+            -----BEGIN RSA PUBLIC KEY-----
+            MIIBCgKCAQEAxquUuiW9a304H9Ls81+2BMm4bviDUU2Zogu0F1mPp6X8TpdjYpDs
+            +tlakSTEPHo+aIdcV9rHpjOC3tirNbYU56D8DdoSo1Ra6XNFbxWrw7usSR9gz7L+
+            kYp1Uij4gKTfg6YQkU0lkufk13if6zvb/GjoBUTS/Tx+8sZm2/JKEK8JLQaCkmMu
+            LAUTsHj35Q8S99TzCLAoQLo136AtvPqcwwHVwkdX+S4WqtlODxfJ7T+9KFxGg54B
+            1M6btg8iL5sdTFrLIBi7oK6GuLK9izvZ4O9O9H2bStW6LodqPtw2v5WA8li+YJx7
+            LBgLO4aAAA6bF9WFcYyKBh6iCX0WxB7LowIDAQAB
+            -----END RSA PUBLIC KEY-----
+          '';
+        };
+      };
+    };
     martha = {
       owner = config.krebs.users.mic92;
       nets = rec {

From ccc66f44d8b82523559703f84b647fba8623c55d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Tue, 16 Feb 2021 08:09:00 +0100
Subject: [PATCH 16/44] mic92: remove dpdkm/inspector

---
 krebs/3modules/external/mic92.nix | 53 -------------------------------
 1 file changed, 53 deletions(-)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index baa54e9e1..3f327855a 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -152,30 +152,6 @@ in {
         };
       };
     };
-    dpdkm = {
-      owner = config.krebs.users.mic92;
-      nets = rec {
-        retiolum = {
-          ip4.addr = "10.243.29.173";
-          aliases = [ "dpdkm.r" ];
-          tinc.pubkey = ''
-            -----BEGIN RSA PUBLIC KEY-----
-            MIICCgKCAgEAuW31xGBdPMSS45KmsCX81yuTcDZv1z7wSpsGQiAw7RsApG0fbBDj
-            NvzWZaZpTTUueG7gtt7U9Gk8DhWYR1hNt8bLXxE5QlY+gxVjU8+caRvlv10Y9XYp
-            qZEr1n1O5R7jS1srvutPt74uiA8I3hBoeP5TXndu8tVcehjRWXPqJj4VCy9pT2gP
-            X880Z30cXm0jUIu9XKhzQU2UNaxbqRzhJTvFUG04M+0a9olsUoN7PnDV6MC5Dxzn
-            f0ZZZDgHkcx6vsSkN/C8Tik/UCXr3tS/VX6/3+PREz6Z3bPd2QfaWdowrlFQPeYa
-            bELPvuqYiq7zR/jw3vVsWX2e91goAfKH5LYKNmzJCj5yYq+knB7Wil3HgBn86zvL
-            Joj56VsuB8fQrrUxjrDetNgtdwci+yFeXkJouQRLM0r0W24liyCuBX4B6nqbj71T
-            B6rAMzhBbl1yixgf31EgiCYFSusk+jiT+hye5lAhes4gBW9GAWxGNU9zE4QeAc1w
-            tkPH/CxRIAeuPYNwmjvYI2eQH9UQkgSBa3/Kz7/KT9scbykbs8nhDHCXwT6oAp+n
-            dR5aHkuBrTQOCU3Xx5ZwU5A0T83oLExIeH8jR1h2mW1JoJDdO85dAOrIBHWnjLls
-            mqrJusBh2gbgvNqIrDaQ9J+o1vefw1QeSvcF71JjF1CEBUmTbUAp8KMCAwEAAQ==
-            -----END RSA PUBLIC KEY-----
-          '';
-        };
-      };
-    };
     herbert = {
       owner = config.krebs.users.mic92;
       nets = rec {
@@ -199,35 +175,6 @@ in {
         };
       };
     };
-    inspector = {
-      owner = config.krebs.users.mic92;
-      nets = rec {
-        internet = {
-          ip4.addr = "141.76.44.154";
-          aliases = [ "inspector.i" ];
-        };
-        retiolum = {
-          via = internet;
-          ip4.addr = "10.243.29.172";
-          aliases = [ "inspector.r" ];
-          tinc.pubkey = ''
-            -----BEGIN RSA PUBLIC KEY-----
-            MIICCgKCAgEAr3l/u7qcxmFa2hUICU3oPDhB2ij2R3lKHyjSsVFVLNfl6TpOdppG
-            EDXOapeXL0s+PfBRHdRI3v/dibj4PG9eyKmFxsUJ2gRz4ghb1UE23aQ3pkr3x8sZ
-            7GR+nJYATYf+jolFF9O1x+f0Uo5xaYWkGOMH8wVVzm6+kcsZOYuTEbJAsbTRZywF
-            m1MdRfk54hLiDsj2rjGRZIR+ZfUKVs2MTWOLCpBAHLJK+r3HfUiR2nAgeNkJCFLw
-            WIir1ftDIViT3Ly6b7enaOkVZ695FNYdPWFZCE4AJI0s9wsbMClzUqCl+0mUkumd
-            eRXgWXkmvBsxR4GECnxUhxs6U8Wh3kbQavvemt4vcIKNhkw32+toYc1AFK/n4G03
-            OUJBbRqgJYx9wIvo8PEu4DTTdsPlQZnMwiaKsn+Gi4Ap6JAnG/iLN8sChoQf7Dau
-            ARZA3sf9CkKx5sZ+9dVrLbzGynKE18Z/ysvf1BLd/rVVOps1B/YRBxDwPj8MZJ0x
-            B7b0j+hRVV5palp3RRdcExuWaBrMQQGsXwLUZOFHJJaZUHF9XRdy+5XVJdNOArkG
-            q1+yGhosL1DLTQE/VwCxmBHyYTr3L7yZ2lSaeWdIeYvcRvouDROUjREVFrQjdqwj
-            7vIP1cvDxSSqA07h/xEC4YZKACBYc/PI2mqYK5dvAUG3mGrEsjHktPUCAwEAAQ==
-            -----END RSA PUBLIC KEY-----
-          '';
-        };
-      };
-    };
     eddie = {
       owner = config.krebs.users.mic92;
       nets = rec {

From 8e75d699785f61e8baed4ade9268811c71d1bbb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Wed, 24 Feb 2021 14:09:22 +0100
Subject: [PATCH 17/44] add github action for autosync

---
 .github/dependabot.yml          |  6 ++++++
 .github/workflows/repo-sync.yml | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 .github/dependabot.yml
 create mode 100644 .github/workflows/repo-sync.yml

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..5ace4600a
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "weekly"
diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml
new file mode 100644
index 000000000..4284463f9
--- /dev/null
+++ b/.github/workflows/repo-sync.yml
@@ -0,0 +1,19 @@
+on:
+  schedule:
+  - cron:  "*/15 * * * *"
+  workflow_dispatch:
+
+jobs:
+  repo-sync:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        persist-credentials: false
+    - name: repo-sync
+      uses: repo-sync/github-sync@v2
+      with:
+        source_repo: "https://git.thalheim.io/Mic92/stockholm.git"
+        source_branch: "master"
+        destination_branch: "master"
+        github_token: ${{ secrets.PAT }}

From 1406f4f9546d307b11a303ada3b572be97380fa1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Mon, 22 Mar 2021 12:38:20 +0100
Subject: [PATCH 18/44] mic92: add anindya

---
 krebs/3modules/external/mic92.nix | 45 +++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 14 deletions(-)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index 3f327855a..e0a3fe2a2 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -252,23 +252,40 @@ in {
     };
     okelmann = {
       owner = config.krebs.users.mic92;
-      nets = {
-        retiolum = {
-          ip4.addr = "10.243.29.190";
+      nets.retiolum = {
+        ip4.addr = "10.243.29.190";
           aliases = [
             "okelmann.r"
           ];
-          tinc.pubkey = ''
-            -----BEGIN RSA PUBLIC KEY-----
-            MIIBCgKCAQEAxquUuiW9a304H9Ls81+2BMm4bviDUU2Zogu0F1mPp6X8TpdjYpDs
-            +tlakSTEPHo+aIdcV9rHpjOC3tirNbYU56D8DdoSo1Ra6XNFbxWrw7usSR9gz7L+
-            kYp1Uij4gKTfg6YQkU0lkufk13if6zvb/GjoBUTS/Tx+8sZm2/JKEK8JLQaCkmMu
-            LAUTsHj35Q8S99TzCLAoQLo136AtvPqcwwHVwkdX+S4WqtlODxfJ7T+9KFxGg54B
-            1M6btg8iL5sdTFrLIBi7oK6GuLK9izvZ4O9O9H2bStW6LodqPtw2v5WA8li+YJx7
-            LBgLO4aAAA6bF9WFcYyKBh6iCX0WxB7LowIDAQAB
-            -----END RSA PUBLIC KEY-----
-          '';
-        };
+        tinc.pubkey = ''
+          -----BEGIN RSA PUBLIC KEY-----
+          MIIBCgKCAQEAxquUuiW9a304H9Ls81+2BMm4bviDUU2Zogu0F1mPp6X8TpdjYpDs
+          +tlakSTEPHo+aIdcV9rHpjOC3tirNbYU56D8DdoSo1Ra6XNFbxWrw7usSR9gz7L+
+          kYp1Uij4gKTfg6YQkU0lkufk13if6zvb/GjoBUTS/Tx+8sZm2/JKEK8JLQaCkmMu
+          LAUTsHj35Q8S99TzCLAoQLo136AtvPqcwwHVwkdX+S4WqtlODxfJ7T+9KFxGg54B
+          1M6btg8iL5sdTFrLIBi7oK6GuLK9izvZ4O9O9H2bStW6LodqPtw2v5WA8li+YJx7
+          LBgLO4aAAA6bF9WFcYyKBh6iCX0WxB7LowIDAQAB
+          -----END RSA PUBLIC KEY-----
+        '';
+      };
+    };
+    anindya = {
+      owner = config.krebs.users.mic92;
+      nets.retiolum = {
+        ip4.addr = "10.243.29.191";
+        aliases = [
+          "anindya.r"
+        ];
+        tinc.pubkey = ''
+          -----BEGIN RSA PUBLIC KEY-----
+          MIIBCgKCAQEA8yWr01WlmM4RYuJdxvzvfdN3C5T3DOknWvK7U3y92HYgtQfYtZwu
+          +J8r1fpTsdIS8wKdSEqz7Mjhb1JabJBB1fv/2mkAF4V/gkMbP0jqZ6QQL29kgkNP
+          aI/+zG1yh4kEDgSn843J6XnTsJ/4Na2zmbVP1iIIQYMXyh+meWsBVR6DKV5ighjz
+          4h3wKbuMmDrS50aTk8ahgWoiqcE2DTUMeprw4SIL+RTepmsCINQtAJui5Ys6AAbK
+          ab6gxMzRH2txLBcTfSrbqTX3qHZHLlB9Ai5FEItWqMBxquD6OCxn8DNU+5LgGpt1
+          Z37SI1U0c4uu1oo7kOSx6wYP2ZVOatys6QIDAQAB
+          -----END RSA PUBLIC KEY-----
+        '';
       };
     };
     martha = {

From 25f6b4d21e824bfda930c9e4441fe81d0216fc07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Tue, 23 Mar 2021 12:31:38 +0100
Subject: [PATCH 19/44] mic92: add dimitra

---
 krebs/3modules/external/mic92.nix | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index e0a3fe2a2..87eb114e0 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -288,6 +288,25 @@ in {
         '';
       };
     };
+    dimitra = {
+      owner = config.krebs.users.mic92;
+      nets.retiolum = {
+        ip4.addr = "10.243.29.192";
+        aliases = [
+          "dimitra.r"
+        ];
+        tinc.pubkey = ''
+          -----BEGIN RSA PUBLIC KEY-----
+          MIIBCgKCAQEAtgvjWP2KIawJDk32P8Uiwz95REACx43CXUIgcBx5qg9ZQrHnJZxH
+          RkXLnWUmjpnEmPUfvg/b8YCyoHgzD6GQEXcWaiMXBQ/nsrSEN4mpY7tzInerzGsv
+          /M66WzPUWSUC9kbncLXt+2A64B23h1ki+MyMyKGIpHq21+F1b6ZHW2rkMnk3BKa4
+          aJKNfadjP4V1lnPd40VBpcA3dlQfGF057GJz+2fzlfh1Bp41r/uP2NHieSAlyBws
+          IaVZPWbfxFyYU8JbrlYUAlLjdXFG1meo5On0K0N8tTBKfnD1nwSqTPAfM7WqOm4A
+          ImYB8LzjmIdXM+QUqbVFTgiY4jBDg61krwIDAQAB
+          -----END RSA PUBLIC KEY-----
+        '';
+      };
+    };
     martha = {
       owner = config.krebs.users.mic92;
       nets = rec {

From 357a5aed9dd8315a5e32404149d6a24ef33707b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Tue, 30 Mar 2021 09:45:39 +0200
Subject: [PATCH 20/44] mic92: update harsha's key

---
 krebs/3modules/external/mic92.nix | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index 87eb114e0..bc1a5a8d9 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -467,12 +467,12 @@ in {
           ];
           tinc.pubkey = ''
             -----BEGIN RSA PUBLIC KEY-----
-            MIIBCgKCAQEAqIc+ozq3hKHMe/X3v4j+6or8LMjEV7MtQ8/+n00xpG4NkI4G38Bv
-            3nmAcV7OhN6of0fr0psbBmym+2VxCZbpl8E3g1GWSKpAvlmP/9v4wDVdrADaTvXC
-            pzCxejtCwEhKLisnMwCMJCuUPbIsSBU+IQDPKP7NP0yY5VapgW3Xl3qXpnehCW1r
-            NBZjZASnhSXcJRLJayEDN6uBviYrnnfbrHOx4fPcjQPTHX5RYr3EbgGZQO9xki44
-            9dKT4EA95lupTqC3wzuQbaNpvIuVzmggiDY/NsBIVh0/2XjGnO54wtCEPudaLnWd
-            WNtc1wfVFB6gzgG1N7msOuFUReOIfyF/ywIDAQAB
+            MIIBCgKCAQEA9VVG+kwSXDmjLuNCT6Mp9xTCj9IdzgjWxkExEH/Jd9kgVNXRa+39
+            P8OQuHXi9fC/51363hh7ThggneIxOs2R4fZDyUcWfzv13aik34U0e+tYjhWXig+o
+            MClkK4/uhLrsk370MQVevpjYW23S5d+pThOm84xIchvjR9nqzp6E3jzjhyeQwHJg
+            dM48y7XT2+7hLvOkkEQ8xLcd35J228wVSilsSYhye1D2+ThRDbjjEkKXnIeOmU5h
+            TPNvn+U0lVdwUDYlS+XUhNl3awRdfzTYlPvUhTWv9zwSxS5EQjvgMqC/3/fQod2K
+            zyYdPwCwEyrksr9JvJF/t+oCw4hf3V4iOwIDAQAB
             -----END RSA PUBLIC KEY-----
           '';
         };

From 76b4c69c9a0888fbd598a7823a1f12d4c01288ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Tue, 13 Apr 2021 16:10:27 +0200
Subject: [PATCH 21/44] mic92: add philipsaendig

---
 krebs/3modules/external/mic92.nix | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index bc1a5a8d9..3d8ed97de 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -307,6 +307,25 @@ in {
         '';
       };
     };
+    philipsaendig = {
+      owner = config.krebs.users.mic92;
+      nets.retiolum = {
+        ip4.addr = "10.243.29.193";
+        aliases = [
+          "philipsaendig.r"
+        ];
+        tinc.pubkey = ''
+          -----BEGIN RSA PUBLIC KEY-----
+          MIIBCgKCAQEAyWdCrXD0M9CIt0ZgVB6W5ozOvLDoxPmGzLBJUnAZV8f9oqfaIEIX
+          5TIaxozN3QMEgS0ChaOHTNFiQZjiiwJL/wPx1eFvKfDkkn7ayrRS/pP+bKhcDpKl
+          4tPejipee9T2ZhYg9tbk291CDBe1fHR5S2F8kPm8OuqwE2Fv9N8wldcsDLxHcTZl
+          +wp4Oe/Wn5WLvZb3SUao17vKnNBLfMMCGC01yRfhZub41NkGYVWBjErsIVxQ+/rF
+          Y7DdCekus+BQCKz+beEmtzG7d0Xwqwkif51HQ05CvwFNEtdUGodd8OrIO+gpIV6S
+          oN+Q5zxsenLo6QRfsLD+nn7A7qbzd57kUwIDAQAB
+          -----END RSA PUBLIC KEY-----
+        '';
+      };
+    };
     martha = {
       owner = config.krebs.users.mic92;
       nets = rec {

From 005137918e1f8dbb28f389dacea7e4bdbc0dc6b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Wed, 21 Apr 2021 20:04:51 +0200
Subject: [PATCH 22/44] mic92: add sauron

---
 krebs/3modules/external/mic92.nix | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index 3d8ed97de..a2a154ebe 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -386,6 +386,34 @@ in {
         };
       };
     };
+    sauron = {
+      owner = config.krebs.users.mic92;
+      nets = rec {
+        internet = {
+          ip4.addr = "129.215.165.75";
+          aliases = [ "sauron.i" ];
+        };
+        retiolum = {
+          via = internet;
+          addrs = [
+            config.krebs.hosts.sauron.nets.retiolum.ip4.addr
+            config.krebs.hosts.sauron.nets.retiolum.ip6.addr
+          ];
+          ip4.addr = "10.243.29.194";
+          aliases = [ "sauron.r" ];
+          tinc.pubkey = ''
+             -----BEGIN RSA PUBLIC KEY-----
+             MIIBCgKCAQEAxmCryT4ZEhPOvdZhWhYZsRS7sz1njSh2ozh6iwXRXhjRjZ9tYZVQ
+             GoYc6ADnWCnb9SGpPe1WqwFMblfKofnXCvC4wLQaFsch1GIMPhujosJ4Te84BHi1
+             XKqyompotE2F7iWYPE6i6UAdRK2dCapfCbiDBOjMhCnmmhM1oY5Bv/fBtx3/2N7E
+             W+iN6LG2t9cKibs8qrLzFtJIfWn8uXU9dkdhX3d9guCdplGOn/NT/Aq3ayvA+/Mf
+             74oJVJgBT5M1rTH2+u+MU+kC+x2UD+jjXEjS55owFWsEM1jI4rGra+dpsDuzdGdG
+             67wl9JlpDBy4Tkf2Bl3CQWZHsWDsR6jCqwIDAQAB
+             -----END RSA PUBLIC KEY-----
+          '';
+        };
+      };
+    };
     rock = {
       owner = config.krebs.users.mic92;
       nets = {

From 2a305c55a7a7ea524c7de79ee681b87f40ea4308 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Wed, 28 Apr 2021 18:13:54 +0200
Subject: [PATCH 23/44] mic92: add bill

---
 krebs/3modules/external/mic92.nix | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index a2a154ebe..d9862fe35 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -414,6 +414,29 @@ in {
         };
       };
     };
+    bill = {
+      owner = config.krebs.users.mic92;
+      nets = rec {
+        retiolum = {
+          addrs = [
+            config.krebs.hosts.bill.nets.retiolum.ip4.addr
+            config.krebs.hosts.bill.nets.retiolum.ip6.addr
+          ];
+          ip4.addr = "10.243.29.195";
+          aliases = [ "bill.r" ];
+          tinc.pubkey = ''
+            -----BEGIN RSA PUBLIC KEY-----
+            MIIBCgKCAQEAzg0wJuDvsbflRKSJ7+ug9y7Gn+BH3CR44fuCPZpWmIcGIUbA6rXj
+            CD8pF5heOvXNCFlEip2wqTkaCJPnUs3x8BRtORmD6OxDdmqt0xH54u7CixKzrPp9
+            GIQydv+ZsGA2z3aDbmBydRPDIvYGhW68FJn10qlGRjCZ5zCl1eVEZ/wMddFXc0B8
+            KDbxh7qOkjXon6EOGACVbnrnUR3F1GsIvCxX0cCDrO0P8XHwwsZiAfUwXYkiqw7t
+            zPcty6Bbr34mSJbb9cFb/qQlfPWT0HVgo+Q65HVkr/64o/9tTyREZcj1dk5PpEPE
+            bt7PGlOF1oPZpVFQh8S+NviHTtqrvkuISQIDAQAB
+            -----END RSA PUBLIC KEY-----
+          '';
+        };
+      };
+    };
     rock = {
       owner = config.krebs.users.mic92;
       nets = {

From 6a9cf75dd9a71fa1b5c07d605e63ff080840a08f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Wed, 28 Apr 2021 18:44:17 +0200
Subject: [PATCH 24/44] mic92: add nardile

---
 krebs/3modules/external/mic92.nix | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index d9862fe35..36d5c5ca6 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -437,6 +437,29 @@ in {
         };
       };
     };
+    nardile = {
+      owner = config.krebs.users.mic92;
+      nets = rec {
+        retiolum = {
+          addrs = [
+            config.krebs.hosts.nardile.nets.retiolum.ip4.addr
+            config.krebs.hosts.nardile.nets.retiolum.ip6.addr
+          ];
+          ip4.addr = "10.243.29.173";
+          aliases = [ "nardile.r" ];
+          tinc.pubkey = ''
+            -----BEGIN RSA PUBLIC KEY-----
+            MIIBCgKCAQEA05JzZLPH4+t2X8TI1nYsv4WCQ/OUmuMy9YbKUIRITE2EVA+x47Cf
+            qdYPucWUpF7ap1rykxHBcPnmORO/NjAymlt25FDyyYQ2uWm17VE7P7jefAUnX7xj
+            80Rt7aWCXfldQuRAbza35G+Kl50Y6ydkZYkKCbyQ8fMhuzNp6Wn/pAJD3yr+zdka
+            AsIoir9Ut9/9CKayRqGF+zaIf2Lj7nl5GL8bCAVJydU98GjlnXt7iuaWCt0H7NiK
+            FWOjkGhAUlQI9I6l+5ELWClpyk5X+isfbUbYaCCspZJvos+vDE8hJuH5PrH8NuJj
+            fJv8HrHkcGphn/Nn1TotpHBkyMyE5h6akwIDAQAB
+            -----END RSA PUBLIC KEY-----
+          '';
+        };
+      };
+    };
     rock = {
       owner = config.krebs.users.mic92;
       nets = {

From 56da4c20e5a87a5cb18e8d74a279e265541c94c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Wed, 28 Apr 2021 18:47:18 +0200
Subject: [PATCH 25/44] mic92: rename nardile to nardole

---
 krebs/3modules/external/mic92.nix | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix
index 36d5c5ca6..15136cbce 100644
--- a/krebs/3modules/external/mic92.nix
+++ b/krebs/3modules/external/mic92.nix
@@ -437,16 +437,16 @@ in {
         };
       };
     };
-    nardile = {
+    nardole = {
       owner = config.krebs.users.mic92;
       nets = rec {
         retiolum = {
           addrs = [
-            config.krebs.hosts.nardile.nets.retiolum.ip4.addr
-            config.krebs.hosts.nardile.nets.retiolum.ip6.addr
+            config.krebs.hosts.nardole.nets.retiolum.ip4.addr
+            config.krebs.hosts.nardole.nets.retiolum.ip6.addr
           ];
           ip4.addr = "10.243.29.173";
-          aliases = [ "nardile.r" ];
+          aliases = [ "nardole.r" ];
           tinc.pubkey = ''
             -----BEGIN RSA PUBLIC KEY-----
             MIIBCgKCAQEA05JzZLPH4+t2X8TI1nYsv4WCQ/OUmuMy9YbKUIRITE2EVA+x47Cf

From 869ac4fc57377009205f9e792e471aeac551992c Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Tue, 4 May 2021 18:23:56 +0200
Subject: [PATCH 26/44] nixpkgs: dec334f -> a565a21

---
 krebs/nixpkgs.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json
index 44a5d0c37..6a5bcdfa5 100644
--- a/krebs/nixpkgs.json
+++ b/krebs/nixpkgs.json
@@ -1,9 +1,9 @@
 {
   "url": "https://github.com/NixOS/nixpkgs",
-  "rev": "dec334fa196a4aeedb1b60d8f7d61aa00d327499",
-  "date": "2021-04-14T01:54:42+02:00",
-  "path": "/nix/store/x1dkzxknsrf0060pz1vwa7ibmq7899wb-nixpkgs",
-  "sha256": "1sm1p2qliz11qw6va01knm0rikhpq2h4c70ci98vi4q26y4q9z72",
+  "rev": "a565a2165ab6e195d7c105a8416b8f4b4d0349a4",
+  "date": "2021-05-04T00:01:38+02:00",
+  "path": "/nix/store/6gp6c5bhcwmywnr0dp8z0qa82kvk48vr-nixpkgs",
+  "sha256": "1x90qm533lh8xh172rqfcj3pwg8imyx650xgr41rqppmm6fli4w1",
   "fetchSubmodules": false,
   "deepClone": false,
   "leaveDotGit": false

From 552b3f23156046003b3fc6a2747606fdd34c11c0 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Tue, 4 May 2021 18:24:26 +0200
Subject: [PATCH 27/44] nixpkgs-unstable: 04a2b26 -> 7cb7620

---
 krebs/nixpkgs-unstable.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json
index 25389ad9c..b8a2e515b 100644
--- a/krebs/nixpkgs-unstable.json
+++ b/krebs/nixpkgs-unstable.json
@@ -1,9 +1,9 @@
 {
   "url": "https://github.com/NixOS/nixpkgs",
-  "rev": "04a2b269d8921505a2969fc9ec25c1f517f2b307",
-  "date": "2021-03-30T01:32:47-04:00",
-  "path": "/nix/store/wb6m2d6p3kadk6pbqdjq3ydswbvmb0lq-nixpkgs",
-  "sha256": "15hgx2i71pqgvzv56jwzfs8rkhjbm35wk1i6mxrqbq6wd0y10isv",
+  "rev": "7cb76200088f45cd24a9aa67fd2f9657943d78a4",
+  "date": "2021-05-03T22:48:10+02:00",
+  "path": "/nix/store/ly8ysjcrb689d095snc83apj3xlkkb14-nixpkgs",
+  "sha256": "12q3jy364nrcixfnd522jc9piagnc16p5b5l57mgp01lk311k7z1",
   "fetchSubmodules": false,
   "deepClone": false,
   "leaveDotGit": false

From e07021528face72dba5c4e8c29ed05c0243855b5 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 5 May 2021 11:43:58 +0200
Subject: [PATCH 28/44] exim: remove 4.94+fixes; upstream has caught up

---
 krebs/5pkgs/override/default.nix | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/krebs/5pkgs/override/default.nix b/krebs/5pkgs/override/default.nix
index e5867926e..926e9dccd 100644
--- a/krebs/5pkgs/override/default.nix
+++ b/krebs/5pkgs/override/default.nix
@@ -10,21 +10,6 @@ self: super: {
     };
   });
 
-  exim = super.exim.overrideAttrs (old: rec {
-    version = warnOldVersion old.version "4.95+fixes";
-    src = self.fetchgit {
-      url = "git://git.exim.org/exim.git";
-      rev = "cdb37db5c0ff060de7edfc94e830cab6b7f7c084";
-      sha256 = "1xaxs1p8yy5f04an5g9mxhj5cvbnzj0xfb50aa1xxkhkqkspzlsg";
-      postFetch = /* sh */ ''
-        ${self.gnutar}/bin/tar xf ${old.src}
-        ${self.rsync}/bin/rsync -vac "$out"/src/ exim-4.94/src
-        rm -R "$out"
-        mv exim-4.94 "$out"
-      '';
-    };
-  });
-
   flameshot = super.flameshot.overrideAttrs (old: rec {
     patches = old.patches or [] ++ [
       (self.writeText "flameshot-imgur.patch" /* diff */ ''

From 72543a5895abb72f48e6048ffb15a5a19f776725 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Wed, 5 May 2021 17:53:06 +0200
Subject: [PATCH 29/44] nixpkgs: a565a21 -> d90df56

---
 krebs/nixpkgs.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json
index 6a5bcdfa5..1d1dee220 100644
--- a/krebs/nixpkgs.json
+++ b/krebs/nixpkgs.json
@@ -1,9 +1,9 @@
 {
   "url": "https://github.com/NixOS/nixpkgs",
-  "rev": "a565a2165ab6e195d7c105a8416b8f4b4d0349a4",
-  "date": "2021-05-04T00:01:38+02:00",
-  "path": "/nix/store/6gp6c5bhcwmywnr0dp8z0qa82kvk48vr-nixpkgs",
-  "sha256": "1x90qm533lh8xh172rqfcj3pwg8imyx650xgr41rqppmm6fli4w1",
+  "rev": "d90df566caff6ef84f7bfccc2a2c95496f221d62",
+  "date": "2021-05-04T18:59:22-04:00",
+  "path": "/nix/store/3jr3hwykb05r9m5g3phpx6f7k2956ny3-nixpkgs",
+  "sha256": "0f1im9c83kyc465k5lsqyhb5saki3dgh5bb1gyyh7gmqlhyvqcax",
   "fetchSubmodules": false,
   "deepClone": false,
   "leaveDotGit": false

From 0f5e7329688483cefed9bb8f342b3a3291c1fc9a Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Wed, 5 May 2021 17:53:22 +0200
Subject: [PATCH 30/44] nixpkgs-unstable: 7cb7620 -> 39e6bf7

---
 krebs/nixpkgs-unstable.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json
index b8a2e515b..83ae57a6f 100644
--- a/krebs/nixpkgs-unstable.json
+++ b/krebs/nixpkgs-unstable.json
@@ -1,9 +1,9 @@
 {
   "url": "https://github.com/NixOS/nixpkgs",
-  "rev": "7cb76200088f45cd24a9aa67fd2f9657943d78a4",
-  "date": "2021-05-03T22:48:10+02:00",
-  "path": "/nix/store/ly8ysjcrb689d095snc83apj3xlkkb14-nixpkgs",
-  "sha256": "12q3jy364nrcixfnd522jc9piagnc16p5b5l57mgp01lk311k7z1",
+  "rev": "39e6bf76474ce742eb027a88c4da6331f0a1526f",
+  "date": "2021-05-04T23:07:42+02:00",
+  "path": "/nix/store/9zbih9x2pfi782vv73v0vjxscmzyf4da-nixpkgs",
+  "sha256": "1pxigbywdq4yf7smas6zq4vhakbkvm1vhj443qjikh77fc8hy17b",
   "fetchSubmodules": false,
   "deepClone": false,
   "leaveDotGit": false

From df3b97623bd639980e02099b86c6872f8434eb6b Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Wed, 12 May 2021 06:54:56 +0200
Subject: [PATCH 31/44] external: add nxdc.r

---
 krebs/3modules/external/default.nix | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix
index 809d5a7db..7a2075702 100644
--- a/krebs/3modules/external/default.nix
+++ b/krebs/3modules/external/default.nix
@@ -537,6 +537,32 @@ in {
         };
       };
     };
+    nxdc = {
+      owner = config.krebs.users.rtjure;
+      nets = {
+        retiolum = {
+          ip4.addr = "10.243.122.125";
+          aliases = [
+            "nxdc.r"
+          ];
+          tinc.pubkey = ''
+            -----BEGIN RSA PUBLIC KEY-----
+            MIICCgKCAgEA2mKpvIpNOlX7adMUQvcExJfPMf7oZggqJBL43nYSOzqK4b3rMUrY
+            SgCYQp9YMf4CMbAuPe4nzAHt9fHqIwNmN8YRh29ku/5tPZDg+OK8zRPoapaeABU4
+            nvW3IxWdGGxyoh9E5MkjHh0Q8Hwt220ZSV5XhlySNOm0cbYRmUqoUtekN+BAzHzA
+            nl9Ew0iCfeu06XlIn/z1vCFxv8Vk5M0dFk87JP0Gpt0JOgVbATPPnsZUNqmrNpQv
+            IDroHUSRQRQmMYs1rlDGC+06QIHOj1WTNxbbntMAPEn9WLaptnSpznJQAvX6hbc/
+            zBwJE4eWkwgpgQcBlqbTE0Zp0T9mU4cpED5dh7X+DU3pDh3T3Tfr+9wIOmNBEaxq
+            a6dQ5kkOTtAIsQ4WIazNMKTJF/abGqjvqJLTAbQjX24ZgpMwH05vodh2Y1KJB2pu
+            XHFqlMgIBnG4lZuS5ZfidLb2b6pl02dG3wTijHrjZFjBQyYCcpcsGoq1iIErae7T
+            HFsjPH+wOKnj1UOxcArl1cubC3QFNHs9bvAFqGzm3u8N4rV71/DTi++Ph3kZ7ed0
+            fR1tW6GVv0icL2rhaATBVgGaMiglaeyRcbiEpkYD0VC499xgPF3JFDxnmBR1g1jZ
+            5UtQV1h8QpBUWkRH/rU1OwhZ/KNcN3Mx5mhs5MSl/Bn/Kwe2URS6eKsCAwEAAQ==
+            -----END RSA PUBLIC KEY-----
+          '';
+        };
+      };
+    };
     ada = {
       owner = config.krebs.users.filly;
       nets = {

From 2af5a3272cbec31581b9a3684b0f9ddd0a144d77 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Sat, 15 May 2021 12:06:09 +0200
Subject: [PATCH 32/44] nixpkgs: d90df56 -> 21ff930

---
 krebs/nixpkgs.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json
index 1d1dee220..7a16fab63 100644
--- a/krebs/nixpkgs.json
+++ b/krebs/nixpkgs.json
@@ -1,9 +1,9 @@
 {
   "url": "https://github.com/NixOS/nixpkgs",
-  "rev": "d90df566caff6ef84f7bfccc2a2c95496f221d62",
-  "date": "2021-05-04T18:59:22-04:00",
-  "path": "/nix/store/3jr3hwykb05r9m5g3phpx6f7k2956ny3-nixpkgs",
-  "sha256": "0f1im9c83kyc465k5lsqyhb5saki3dgh5bb1gyyh7gmqlhyvqcax",
+  "rev": "21ff9308b75d448765f7c3704a1459a3d8e1c844",
+  "date": "2021-05-14T13:57:54+00:00",
+  "path": "/nix/store/xdd7c619y10n0fll9zk32fzd62yhil90-nixpkgs",
+  "sha256": "0i32d1q5v9a0q4y1s010afn6vxljbliilq5cs63mk6sdw3kryj2b",
   "fetchSubmodules": false,
   "deepClone": false,
   "leaveDotGit": false

From a888295ee6ad1a57ebfd3e10e612a7ca5448df39 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@lassul.us>
Date: Sat, 15 May 2021 12:18:22 +0200
Subject: [PATCH 33/44] nixpkgs-unstable: 39e6bf7 -> d1601a4

---
 krebs/nixpkgs-unstable.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json
index 83ae57a6f..da50df9c9 100644
--- a/krebs/nixpkgs-unstable.json
+++ b/krebs/nixpkgs-unstable.json
@@ -1,9 +1,9 @@
 {
   "url": "https://github.com/NixOS/nixpkgs",
-  "rev": "39e6bf76474ce742eb027a88c4da6331f0a1526f",
-  "date": "2021-05-04T23:07:42+02:00",
-  "path": "/nix/store/9zbih9x2pfi782vv73v0vjxscmzyf4da-nixpkgs",
-  "sha256": "1pxigbywdq4yf7smas6zq4vhakbkvm1vhj443qjikh77fc8hy17b",
+  "rev": "d1601a40c48426ae460eede1675fd1d6ee23e198",
+  "date": "2021-05-13T06:19:30-04:00",
+  "path": "/nix/store/6ifpfakc5am0dz25w40y2jgr4jhvr3iz-nixpkgs",
+  "sha256": "00nl5b0ncqrcv6zr000dxk1jdvs7aj4s53njiyrh3sn78w1nghl6",
   "fetchSubmodules": false,
   "deepClone": false,
   "leaveDotGit": false

From ceaf0a09a2bba72f8db89da6c11e246201165fd3 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:08:41 +0200
Subject: [PATCH 34/44] ma bgt/etherpad: bump to latest version

---
 makefu/2configs/bgt/etherpad.euer.krebsco.de.nix | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix b/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix
index 48b947c58..cf5b22bae 100644
--- a/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix
+++ b/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix
@@ -30,8 +30,12 @@ in {
         proxy_read_timeout 1799s;
     '';
   };
-  docker-containers."etherpad-lite" = {
-    image = "makefoo/bgt-etherpad:2020-05-02.6";
+  state = [ "/var/lib/docker/volumes/etherpad_data/_data/" ];
+  virtualisation.oci-containers.containers."etherpad-lite" = {
+    image = "makefoo/bgt-etherpad:2021-04-16.3"; # --build-arg ETHERPAD_PLUGINS="ep_markdown"
+    # ep_codepad does not work anymore
+
+    #image = "etherpad/etherpad:1.8.13";
     ports = [ "127.0.0.1:${toString port}:9001" ];
     volumes = [
       "/var/src/secrets/etherpad/apikey:/opt/etherpad-lite/APIKEY.txt"
@@ -46,7 +50,10 @@ in {
   #DB_PASS=mypassword
     environment = {
       # ADMIN_PASSWORD = "auf jeden fall nicht das echte admin passwort";
+      # LOGLEVEL = "DEBUG";
+
       SUPPRESS_ERRORS_IN_PAD_TEXT = "true";
+      TRUST_PROXY =  "true";
       TITLE = "Binärgewitter Etherpad";
       SKIN_NAME = "no-skin";
       DEFAULT_PAD_TEXT = builtins.replaceStrings ["\n"] ["\\n"] (builtins.readFile ./template.md);

From db56b51ab4d1cecc0e7e664e51b89f04d360680a Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:10:57 +0200
Subject: [PATCH 35/44] ma social-to-irc: restart brockman

---
 makefu/2configs/bgt/social-to-irc.nix | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/makefu/2configs/bgt/social-to-irc.nix b/makefu/2configs/bgt/social-to-irc.nix
index dc975c359..ac4c6cad3 100644
--- a/makefu/2configs/bgt/social-to-irc.nix
+++ b/makefu/2configs/bgt/social-to-irc.nix
@@ -1,10 +1,16 @@
 {
-  # systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG";
+  systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG";
+  systemd.services.restart-brockman = {
+    after = [ "brockman.service" ];
+    wantedBy = [ "multi-user.target" ];
+    startAt = "daily";
+    script = "${pkgs.systemd}/bin/systemctl try-restart brockman.service";
+  };
   krebs.brockman = {
     enable = true;
     config = {
       channel = "#binaergewitter";
-      notifyErrors =  false;
+      notifyErrors = false;
       irc = {
         host = "irc.freenode.net";
         port = 6667;

From 4d08eada4ede46463abfc74b7a03881c26d34b00 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:12:03 +0200
Subject: [PATCH 36/44] ma bgt/template: add note about three dashes

---
 makefu/2configs/bgt/template.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/makefu/2configs/bgt/template.md b/makefu/2configs/bgt/template.md
index d30cb49eb..af5de0697 100644
--- a/makefu/2configs/bgt/template.md
+++ b/makefu/2configs/bgt/template.md
@@ -21,6 +21,7 @@
 ## Vorschläge
 ### Backlog von Picks und Lesefoo aus der letzten Woche
 
+die Nachfolgenden 3 Striche sind sehr wichtig, bitte nicht löschen
 ---
 
 ## Blast from the Past

From 7f515fd150eb7672f272ee61f581ae7e0ff76e86 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:12:25 +0200
Subject: [PATCH 37/44] ma bureautomation: disable pykodi

---
 makefu/2configs/bureautomation/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix
index aa13b62b7..669754caf 100644
--- a/makefu/2configs/bureautomation/default.nix
+++ b/makefu/2configs/bureautomation/default.nix
@@ -59,7 +59,7 @@ in {
       extraPackages = p: [ 
         # TODO: put somewhere else
         (p.callPackage <stockholm/makefu/2configs/home/ham/deps/dwdwfsapi.nix> {})
-        (p.callPackage <stockholm/makefu/2configs/home/ham/deps/pykodi.nix> {})
+        # (p.callPackage <stockholm/makefu/2configs/home/ham/deps/pykodi.nix> {})
         p.APScheduler ];
     };
     autoExtraComponents = true;
@@ -147,7 +147,7 @@ in {
       frontend = { };
       http = {
         # TODO: https://github.com/home-assistant/home-assistant/issues/16149
-        base_url = "http://192.168.8.11:8123";
+        # base_url = "http://192.168.8.11:8123";
       };
       conversation = {};
       history = {};

From 485807c22d20db9684612333cfda0b1fa63cf45a Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:13:13 +0200
Subject: [PATCH 38/44] ma home/ham: add signal-rest, update automations

---
 .../home/ham/automation/fenster_auf.nix       |  63 ++++++--
 .../home/ham/automation/giesskanne.nix        |   4 +-
 .../home/ham/automation/lichter_dimmen.nix    | 135 ++++++++++++++++++
 .../pflanzen_giessen_erinnerung.nix           |  39 +++++
 .../2configs/home/ham/calendar/nextcloud.nix  |  30 ++++
 makefu/2configs/home/ham/default.nix          |  21 +--
 .../home/ham/multi/kurzzeitwecker.nix         |  11 +-
 .../2configs/home/ham/signal-rest/default.nix |  20 +--
 makefu/2configs/home/ham/signal-rest/hass.nix |  20 +++
 makefu/2configs/home/ham/signal-rest/pkg.nix  |  25 ++++
 .../2configs/home/ham/signal-rest/service.nix |  18 +++
 makefu/2configs/home/zigbee2mqtt/default.nix  |   1 -
 12 files changed, 344 insertions(+), 43 deletions(-)
 create mode 100644 makefu/2configs/home/ham/automation/lichter_dimmen.nix
 create mode 100644 makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix
 create mode 100644 makefu/2configs/home/ham/signal-rest/hass.nix
 create mode 100644 makefu/2configs/home/ham/signal-rest/pkg.nix
 create mode 100644 makefu/2configs/home/ham/signal-rest/service.nix

diff --git a/makefu/2configs/home/ham/automation/fenster_auf.nix b/makefu/2configs/home/ham/automation/fenster_auf.nix
index ccebd5b00..871f248b9 100644
--- a/makefu/2configs/home/ham/automation/fenster_auf.nix
+++ b/makefu/2configs/home/ham/automation/fenster_auf.nix
@@ -1,3 +1,8 @@
+{ lib, ... }:
+#uses:
+# notify.signal
+# binary_sensor.badezimmer_fenster_contact
+# binary_sensor.dusche_fenster_contact
 let
   min = 20;
   fenster_offen = name: entity:
@@ -13,21 +18,57 @@ let
       action =
       [
         {
-          service = "notify.firetv_wohnzimmer";
+          service = "notify.signal_home";
           data = {
-            title = "${name} seit ${toString min} Minuten offen";
-            message = "Bitte einmal checken ob das ok ist :)";
-            data = {
-              interrupt = 1;
-              duration = 300;
-            };
+            message= "${name} seit ${toString min} Minuten offen\nBitte einmal checken ob das ok ist :)";
           };
         }
+        {
+          service = "input_boolean.turn_on";
+          target.entity_id = "input_boolean.${lib.toLower name}_lang_offen";
+        }
+      ];
+    };
+  fenster_geschlossen_lang = name: entity:
+    { alias = "${name} wieder geschlossen";
+      trigger = [
+          {
+            platform = "state";
+            entity_id = entity;
+            to = "off";
+          }
+        ];
+      condition = [
+        { condition = "state";
+          entity_id = "input_boolean.${lib.toLower name}_lang_offen";
+          state = "on";
+        }
+      ];
+      action =
+      [
+        {
+          service = "notify.signal_home";
+          data = {
+            message= "${name} ist wieder geschlossen, Danke!";
+          };
+        }
+        {
+          service = "input_boolean.turn_off";
+          target.entity_id = "input_boolean.${lib.toLower name}_lang_offen";
+        }
       ];
     };
 in {
-  services.home-assistant.config.automation = [
-    (fenster_offen "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact")
-    (fenster_offen "Duschfenster" "binary_sensor.dusche_fenster_contact")
-  ];
+  services.home-assistant.config = {
+    input_boolean = {
+      badezimmerfinester_lang_offen.name = "Badezimmer lange offen";
+      duschfenster_lang_offen.name = "Duschfenster lange offen";
+    };
+    automation = [
+      (fenster_geschlossen_lang "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact")
+      (fenster_geschlossen_lang "Duschfenster" "binary_sensor.badezimmer_fenster_contact")
+      (fenster_offen "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact")
+      (fenster_offen "Duschfenster" "binary_sensor.dusche_fenster_contact")
+    ];
+  };
 }
diff --git a/makefu/2configs/home/ham/automation/giesskanne.nix b/makefu/2configs/home/ham/automation/giesskanne.nix
index 4b0fb61dd..b11fd9d52 100644
--- a/makefu/2configs/home/ham/automation/giesskanne.nix
+++ b/makefu/2configs/home/ham/automation/giesskanne.nix
@@ -5,9 +5,9 @@ let
     name = "chilicam";
     camera = "camera.espcam_02";
     light = "light.espcam_02_light";
-    seconds = 60; # default shutoff to protect the LED from burning out
+    seconds = 90; # default shutoff to protect the LED from burning out
   };
-  seconds = 60;
+  seconds = 70; # time for giesskanne
   pump = "switch.arbeitszimmer_giesskanne_relay";
   # sensor = "sensor.statistics_for_sensor_crafting_brotbox_soil_moisture";
 in
diff --git a/makefu/2configs/home/ham/automation/lichter_dimmen.nix b/makefu/2configs/home/ham/automation/lichter_dimmen.nix
new file mode 100644
index 000000000..4303cdfa5
--- /dev/null
+++ b/makefu/2configs/home/ham/automation/lichter_dimmen.nix
@@ -0,0 +1,135 @@
+# This module maps the RF433 Remote Control to zigbee and wifi lights
+let
+  rf_turn_off = code: light:
+  {
+    alias = "Turn off ${light} via rf code ${code}";
+    trigger = {
+      platform = "event";
+      event_type = "esphome.rf_code_received";
+      event_data.code = code;
+    };
+    action = {
+      service = "light.turn_off";
+      data.entity_id = light;
+    };
+  };
+  rf_turn_on = code: light:
+  {
+    alias = "Turn on ${light} via rf code ${code}";
+    trigger = {
+      platform = "event";
+      event_type = "esphome.rf_code_received";
+      event_data.code = code;
+    };
+    action = {
+      service = "light.turn_on";
+      data.entity_id = light;
+    };
+  };
+  rf_state = code: light: halfbright:
+  let
+    maxbright = 255;
+    transition = 0.2; # seconds
+  in
+  # this function implements a simple state machine based on the state and brightness of the light (light must support brightness
+  {
+    alias = "Cycle through states of ${light} via rf code ${code}";
+    trigger = {
+      platform = "event";
+      event_type = "esphome.rf_code_received";
+      event_data.code = code;
+    };
+    action = {
+      choose = [
+        {
+          # state 0: off to half
+          conditions = {
+            condition = "template";
+            value_template = ''{{ states("${light}")  == "off" }}'';
+          };
+          sequence = [
+            {
+              service = "light.turn_on";
+              data = {
+                entity_id = light;
+                brightness = halfbright;
+              };
+            }
+          ];
+        }
+        {
+          # state 1: half to full
+          conditions = {
+            condition = "template";
+            value_template = ''{{ states('${light}')  == 'on' and ( ${toString (halfbright - 1)} <= state_attr("${light}","brightness") <= ${toString (halfbright + 1)})}}'';
+          };
+          sequence = [
+            {
+              service = "light.turn_on";
+              data = {
+                entity_id = light;
+                brightness = maxbright;
+              };
+            }
+          ];
+        }
+        {
+          # state 2: full to off
+          conditions =  {
+            condition = "template";
+            # TODO: it seems like the devices respond with brightness-1 , maybe off-by-one somewhere?
+            value_template = ''{{ states("${light}")  == "on" and state_attr("${light}","brightness") >= ${toString (maxbright - 1)}}}'';
+          };
+          sequence = [
+            {
+              service = "light.turn_off";
+              data = {
+                entity_id = light;
+              };
+            }
+          ];
+        }
+      ];
+      # default: on to off
+      # this works because state 0 checks for "state == off"
+      default = [{
+        service = "light.turn_off";
+        data = {
+          entity_id = light;
+        };
+      }];
+    };
+  }
+;
+  rf_toggle = code: light:
+  {
+    alias = "Toggle ${light} via rf code ${code}";
+    trigger = {
+      platform = "event";
+      event_type = "esphome.rf_code_received";
+      event_data.code = code;
+    };
+    action = {
+      service = "light.toggle";
+      data.entity_id = light;
+    };
+  };
+in
+{
+  services.home-assistant.config.automation = [
+      (rf_toggle "400551" "light.wohnzimmer_fernseher_led_strip")        # A
+      (rf_state "401151" "light.wohnzimmer_stehlampe_osram" 128)            # B
+      (rf_state "401451" "light.wohnzimmer_komode_osram" 128)               # C
+      (rf_state "401511" "light.wohnzimmer_schrank_osram" 128)              # D
+
+                                                                        # OFF Lane
+      (rf_turn_off "400554" "all")                                       # A
+      (rf_toggle "401154" "light.wohnzimmer_fenster_lichterkette_licht") # B
+      (rf_toggle "401454" "light.wohnzimmer_fernsehwand_led")            # C
+      # (rf_toggle "401514" "")   # D
+  ];
+    # "400554" # A OFF
+    # "401154" # B OFF
+    # "401454" # C OFF
+    # "401514" # D OFF
+}
diff --git a/makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix b/makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix
new file mode 100644
index 000000000..3aaa57bd6
--- /dev/null
+++ b/makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix
@@ -0,0 +1,39 @@
+let
+  notify_felix = message: {
+    service = "notify.signal_felix";
+    data.message = message;
+  };
+  notify_home = message: {
+    service = "notify.signal_home";
+    data.message = message;
+  };
+in
+{
+  services.home-assistant.config.automation =
+  [
+    {
+      alias = "Pflanzen Giessen Erinnerung Daily";
+      trigger = {
+        platform = "time";
+        at = "12:15:00";
+      };
+      action = [
+        (notify_felix "Es ist Mittagszeit und du kannst ruhig einmal alle Blumen im Zimmer giessen")
+      ];
+    }
+    {
+      alias = "Pflanzen Giessen Erinnerung Weekly";
+      trigger = {
+        platform = "time";
+        at = "12:15:00";
+      };
+      condition = {
+        condition = "time";
+        weekday = [ "sat" ];
+      };
+      action = [
+        (notify_home "Es ist Wochenende und die Pflanzen würden sich über ein bisschen Wasser freuen.")
+      ];
+    }
+  ];
+}
diff --git a/makefu/2configs/home/ham/calendar/nextcloud.nix b/makefu/2configs/home/ham/calendar/nextcloud.nix
index 80e51b348..6035904cc 100644
--- a/makefu/2configs/home/ham/calendar/nextcloud.nix
+++ b/makefu/2configs/home/ham/calendar/nextcloud.nix
@@ -8,6 +8,36 @@ in
       platform = "caldav";
       inherit (cred) username password;
       url = "https://o.euer.krebsco.de/remote.php/dav";
+      # make calendars "all-day" before uploading:
+      #   sed -i -e 's/^\(DTSTART;.*\)T......\r$/\1\r/' -e #   's/^\(DTEND;.*\)T......\r$/\1\r/' abfall.ical
+      custom_calendars = [
+        {
+          name = "Gelbersack";
+          calendar = "Abfall";
+          search = "Gelber Sack.*";
+        }
+        {
+          name = "Biomuell";
+          calendar = "Abfall";
+          search = "Bio.*";
+        }
+        {
+          name = "Restmuell";
+          calendar = "Abfall";
+          search = "Rest.*";
+        }
+        {
+          name = "Papiermuell";
+          calendar = "Abfall";
+          search = "Altpapier.*";
+        }
+        {
+          name = "Kehrwoche";
+          calendar = "Kehrwoche";
+          search = ".*";
+        }
+      ];
     }
+
   ];
 }
diff --git a/makefu/2configs/home/ham/default.nix b/makefu/2configs/home/ham/default.nix
index ee3b62428..11894906e 100644
--- a/makefu/2configs/home/ham/default.nix
+++ b/makefu/2configs/home/ham/default.nix
@@ -33,7 +33,8 @@ in {
     ./automation/firetv_restart.nix
     ./automation/light_buttons.nix
     ./automation/wohnzimmer_rf_fernbedienung.nix
-    ./automation/giesskanne.nix
+    #./automation/giesskanne.nix
+    ./automation/pflanzen_giessen_erinnerung.nix
     #./automation/urlaub.nix
     ./automation/moodlight.nix
 
@@ -48,7 +49,9 @@ in {
     })).override {
       extraPackages = p: [ 
         (p.callPackage ./deps/dwdwfsapi.nix {}) 
-        (p.callPackage ./deps/pykodi.nix {}) ];
+        (p.callPackage ./signal-rest/pkg.nix {}) 
+        #(p.callPackage ./deps/pykodi.nix {}) 
+      ];
     };
 
     config = {
@@ -103,11 +106,11 @@ in {
       #    (builtins.readFile <secrets/hass/telegram-bot.json>))
       #];
       notify = [
-        {
-          platform = "kodi";
-          name = "Kodi Wohnzimmer";
-          host = firetv_stick;
-        }
+        #{
+        #  platform = "kodi";
+        #  name = "Kodi Wohnzimmer";
+        #  host = firetv_stick;
+        #}
         {
           platform = "nfandroidtv";
           name = "FireTV Wohnzimmer";
@@ -166,8 +169,10 @@ in {
       };
       #binary_sensor =
       #   flurlicht.binary_sensor;
+
       sensor = [
-        { platform = "speedtest";
+        { platform = "speedtestdotnet";
+          scan_interval.hours = 6;
           monitored_conditions = [ "ping" "download" "upload" ];
         }
         # https://www.home-assistant.io/cookbook/automation_for_rainy_days/
diff --git a/makefu/2configs/home/ham/multi/kurzzeitwecker.nix b/makefu/2configs/home/ham/multi/kurzzeitwecker.nix
index bd81465cb..a0748e205 100644
--- a/makefu/2configs/home/ham/multi/kurzzeitwecker.nix
+++ b/makefu/2configs/home/ham/multi/kurzzeitwecker.nix
@@ -5,9 +5,10 @@
 
 # Needs:
 #  sensor.zigbee_btn1_click
-#  notify.telegrambot
+#  notify.signal_home
 let
   button = "sensor.zigbee_btn2_click";
+  notify = "notify.signal_home";
 in
 {
   services.home-assistant.config = {
@@ -56,7 +57,7 @@ in
             data.duration = "00:05:00";
           }
           {
-            service = "notify.telegrambot";
+            service = notify;
             data.message = "Timer gestartet {{state_attr('timer.kurzzeitwecker', 'remaining') }}, verbleibend ";
           }
         ];
@@ -79,7 +80,7 @@ in
             entity_id =  "script.add_5_minutes_to_kurzzeitwecker";
           }
           {
-            service = "notify.telegrambot";
+            service = notify;
             data.message = ''Timer um 5 minuten verlängert, {{ state_attr('timer.kurzzeitwecker', 'remaining') | truncate(9,True," ") }} verbleibend '';
           }
         ];
@@ -111,7 +112,7 @@ in
             entity_id =  "timer.kurzzeitwecker";
           }
           {
-            service = "notify.telegrambot";
+            service = notify;
             data.message = "Timer gestoppt, abgebrochen";
           }
         ];
@@ -125,7 +126,7 @@ in
         };
         action = [
           {
-            service = "notify.telegrambot";
+            service = notify;
             data.message = "Timer beendet";
           }
         ];
diff --git a/makefu/2configs/home/ham/signal-rest/default.nix b/makefu/2configs/home/ham/signal-rest/default.nix
index 250a3596d..4eac41ba8 100644
--- a/makefu/2configs/home/ham/signal-rest/default.nix
+++ b/makefu/2configs/home/ham/signal-rest/default.nix
@@ -1,18 +1,6 @@
-
-let
-  port = 8631;
-  image = "bbernhard/signal-cli-rest-api:latest";
-  config = "/var/lib/signal-cli-config";
-in {
-  systemd.tmpfiles.rules = [
-    "d ${config} docker docker - -"
+{
+  imports = [
+    ./service.nix
+    ./hass.nix
   ];
-  state = [ config ];
-  virtualisation.oci-containers.containers.signal-rest = {
-    image = image;
-    ports = [ "127.0.0.1:${toString port}:8080" ];
-    volumes = [
-      "${config}:/home/.local/share/signal-cli"
-    ];
-  };
 }
diff --git a/makefu/2configs/home/ham/signal-rest/hass.nix b/makefu/2configs/home/ham/signal-rest/hass.nix
new file mode 100644
index 000000000..284be3320
--- /dev/null
+++ b/makefu/2configs/home/ham/signal-rest/hass.nix
@@ -0,0 +1,20 @@
+let
+  inherit (import <secrets/signal/messenger.nix>) number home felix;
+in {
+  services.home-assistant.config.notify = [
+    {
+      name = "signal_home";
+      platform = "signal_messenger";
+      url = "http://127.0.0.1:8631";
+      inherit number ;
+      recipients = [ home ];
+    }
+    {
+      name = "signal_felix";
+      platform = "signal_messenger";
+      url = "http://127.0.0.1:8631";
+      inherit number;
+      recipients = [ felix ];
+    }
+  ];
+}
diff --git a/makefu/2configs/home/ham/signal-rest/pkg.nix b/makefu/2configs/home/ham/signal-rest/pkg.nix
new file mode 100644
index 000000000..165d642af
--- /dev/null
+++ b/makefu/2configs/home/ham/signal-rest/pkg.nix
@@ -0,0 +1,25 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "pysignalclirestapi";
+  version = "0.3.14";
+
+  # disabled = ; # requires python version >=2.7
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "6f3626b594a53c4161dfc67ea7a3b23d62c8fe8cb404a909496118aeefa79cd0";
+  };
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Small python library for the Signal Cli REST API";
+    homepage = https://github.com/bbernhard/pysignalclirestapi;
+    #license = licenses.;
+    # maintainers = [ maintainers. ];
+  };
+}
diff --git a/makefu/2configs/home/ham/signal-rest/service.nix b/makefu/2configs/home/ham/signal-rest/service.nix
new file mode 100644
index 000000000..250a3596d
--- /dev/null
+++ b/makefu/2configs/home/ham/signal-rest/service.nix
@@ -0,0 +1,18 @@
+
+let
+  port = 8631;
+  image = "bbernhard/signal-cli-rest-api:latest";
+  config = "/var/lib/signal-cli-config";
+in {
+  systemd.tmpfiles.rules = [
+    "d ${config} docker docker - -"
+  ];
+  state = [ config ];
+  virtualisation.oci-containers.containers.signal-rest = {
+    image = image;
+    ports = [ "127.0.0.1:${toString port}:8080" ];
+    volumes = [
+      "${config}:/home/.local/share/signal-cli"
+    ];
+  };
+}
diff --git a/makefu/2configs/home/zigbee2mqtt/default.nix b/makefu/2configs/home/zigbee2mqtt/default.nix
index 873699e3f..95ee56835 100644
--- a/makefu/2configs/home/zigbee2mqtt/default.nix
+++ b/makefu/2configs/home/zigbee2mqtt/default.nix
@@ -40,7 +40,6 @@ in
         log_output = [ "console" ];
         last_seen = "ISO_8601";
         elapsed = true;
-        reporting = true; # TODO test if it is better with groups
         pan_id = 6755;
         inherit (sec.zigbee) network_key;
       };

From 41e87ff78857eb209b9598ee9aee8c6fa73a1af0 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:17:09 +0200
Subject: [PATCH 39/44] ma printer: update

---
 makefu/2configs/printer.nix | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix
index 89b5e0579..72b9dadd6 100644
--- a/makefu/2configs/printer.nix
+++ b/makefu/2configs/printer.nix
@@ -21,20 +21,26 @@ in {
   hardware.sane = {
     enable = true;
     extraBackends = [ ];
-    netConf =
-      # drucker.lan SCX-3205W
-      ''
-        192.168.111.16''
-      # uhrenkind.shack magicolor 1690mf
-    + ''
-        10.42.20.30'';
+    extraConfig.xerox_mfp = ''
+      usb 0x04e8 0x3441
+    '';
+    #netConf =
+    #  # drucker.lan SCX-3205W
+    #  ''
+    #    192.168.111.16''
+    #  # uhrenkind.shack magicolor 1690mf
+    #+ ''
+    #    10.42.20.30'';
 
-    # $ scanimage -p --format=jpg --mode=Gray --source="Automatic Document Feeder" -v --batch="lol%d.jpg" --resolution=150
+    ## $ scanimage -p --format=jpg --mode=Gray --source="Automatic Document Feeder" -v --batch="lol%d.jpg" --resolution=150
 
-    # requires 'sane-extra', scan via:
-    extraConfig."magicolor" = ''
-      net 10.42.20.30 0x2098
-    ''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf
+    ## requires 'sane-extra', scan via:
+    #extraConfig."magicolor" = ''
+    #  net 10.42.20.30 0x2098
+    #''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf
   };
   state = [ "/var/lib/cups" ];
+  services.udev.extraRules = ''
+    ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3441", ENV{libsane_matched}="yes"
+  '';
 }

From a8fb43be6af717901d8423e0801f6a52fa264e79 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:17:28 +0200
Subject: [PATCH 40/44] ma ircbot: restart brockman

---
 makefu/2configs/systemdultras/ircbot.nix | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/makefu/2configs/systemdultras/ircbot.nix b/makefu/2configs/systemdultras/ircbot.nix
index 47709de1e..006cafec0 100644
--- a/makefu/2configs/systemdultras/ircbot.nix
+++ b/makefu/2configs/systemdultras/ircbot.nix
@@ -1,5 +1,11 @@
-{
+{ pkgs, ... }: {
   systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG";
+  systemd.services.restart-brockman = {
+    after = [ "brockman.service" ];
+    wantedBy = [ "multi-user.target" ];
+    startAt = "daily";
+    script = "${pkgs.systemd}/bin/systemctl try-restart brockman.service";
+  };
   krebs.brockman = {
     enable = true;
     config = {

From c0cc625a9f005352b8bb4857af09989865ed6ffd Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:17:43 +0200
Subject: [PATCH 41/44] ma tools/extra-gui: add vscode

---
 makefu/2configs/tools/extra-gui.nix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/makefu/2configs/tools/extra-gui.nix b/makefu/2configs/tools/extra-gui.nix
index aae00b97d..5a29eea85 100644
--- a/makefu/2configs/tools/extra-gui.nix
+++ b/makefu/2configs/tools/extra-gui.nix
@@ -17,5 +17,6 @@
     gitAndTools.gitFull
     signal-desktop
     # rambox
+    vscode
   ];
 }

From a9559220882b3f9959173e6c38e93033c46c3357 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:18:36 +0200
Subject: [PATCH 42/44] ma pkgs.studio-link: bump to 21.03.2

---
 makefu/5pkgs/studio-link/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/makefu/5pkgs/studio-link/default.nix b/makefu/5pkgs/studio-link/default.nix
index 16954a9ae..4d595d9f8 100644
--- a/makefu/5pkgs/studio-link/default.nix
+++ b/makefu/5pkgs/studio-link/default.nix
@@ -11,11 +11,11 @@
 
 stdenv.mkDerivation rec {
   name = "studio-link-${version}";
-  version = "20.05.5";
+  version = "21.03.2";
 
   src = fetchurl {
     url = "https://download.studio.link/releases/v${version}-stable/linux/studio-link-standalone-v${version}.tar.gz";
-    sha256 = "0wmcvihyxf4xvgrspvy3qhhabczv86hdfcfq61jv51hfrzibc2q1";
+    sha256 = "0szaym9lrkbnwxaffab9snlsij6kkwlin70d36bm3vi2la8iayc6";
   };
 
   nativeBuildInputs = [

From fc7efc4623fca09687b97fe61a713e4c1336d2fa Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 13:20:06 +0200
Subject: [PATCH 43/44] ma tests: add signal dummy secrets

---
 makefu/0tests/data/secrets/signal/messenger.nix | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 makefu/0tests/data/secrets/signal/messenger.nix

diff --git a/makefu/0tests/data/secrets/signal/messenger.nix b/makefu/0tests/data/secrets/signal/messenger.nix
new file mode 100644
index 000000000..b43bb3897
--- /dev/null
+++ b/makefu/0tests/data/secrets/signal/messenger.nix
@@ -0,0 +1,6 @@
+{
+  number = "+1dotdotdot";
+  home = "group.ABCDE";
+  felix = "group.ABCDE";
+
+}

From 5bf33d683cbf6f43599ae97aa1c56b1fd0d7d3f3 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sat, 15 May 2021 14:03:43 +0200
Subject: [PATCH 44/44] ma gum: disable social-to-irc, fix import for omo

---
 makefu/1systems/gum/config.nix        | 2 +-
 makefu/2configs/bgt/social-to-irc.nix | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix
index 862dfb53e..763d36841 100644
--- a/makefu/1systems/gum/config.nix
+++ b/makefu/1systems/gum/config.nix
@@ -160,7 +160,7 @@ in {
       <stockholm/makefu/2configs/bgt/download.binaergewitter.de.nix>
       <stockholm/makefu/2configs/bgt/hidden_service.nix>
       <stockholm/makefu/2configs/bgt/backup.nix>
-      <stockholm/makefu/2configs/bgt/social-to-irc.nix>
+      # <stockholm/makefu/2configs/bgt/social-to-irc.nix>
 
       # <stockholm/makefu/2configs/logging/client.nix>
 
diff --git a/makefu/2configs/bgt/social-to-irc.nix b/makefu/2configs/bgt/social-to-irc.nix
index ac4c6cad3..8e81f9b50 100644
--- a/makefu/2configs/bgt/social-to-irc.nix
+++ b/makefu/2configs/bgt/social-to-irc.nix
@@ -1,3 +1,4 @@
+{ pkgs, ... }:
 {
   systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG";
   systemd.services.restart-brockman = {