diff options
Diffstat (limited to 'makefu')
51 files changed, 1742 insertions, 111 deletions
diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 9585d8599..3b084d35a 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -81,7 +81,7 @@ in { # ci # <stockholm/makefu/2configs/exim-retiolum.nix> <stockholm/makefu/2configs/git/cgit-retiolum.nix> - <stockholm/makefu/2configs/shack/events-publisher> + # <stockholm/makefu/2configs/shack/events-publisher> <stockholm/makefu/2configs/shack/gitlab-runner> <stockholm/makefu/2configs/remote-build/slave.nix> <stockholm/makefu/2configs/remote-build/aarch64-community.nix> @@ -90,36 +90,20 @@ in { # services # <stockholm/makefu/2configs/sabnzbd.nix> <stockholm/makefu/2configs/mail/mail.euer.nix> - { - krebs.exim.enable = mkForce false; - } + { krebs.exim.enable = mkForce false; } # sharing <stockholm/makefu/2configs/share/gum.nix> <stockholm/makefu/2configs/torrent.nix> - { services.sickbeard = { - enable = true; - package = pkgs.sickgear; - user = "sickbeard"; - group = "download"; - port = 8280; - }; - services.nginx.virtualHosts."sick.makefu.r" = { - locations."/".proxyPass = http://localhost:8280; - extraConfig = '' - if ( $server_addr = "${external-ip}" ) { - return 403; - } - ''; - }; - users.users.sickbeard.extraGroups = [ "nginx" ]; - } + <stockholm/makefu/2configs/sickbeard> + { nixpkgs.config.allowUnfree = true; } #<stockholm/makefu/2configs/retroshare.nix> ## <stockholm/makefu/2configs/ipfs.nix> #<stockholm/makefu/2configs/syncthing.nix> # <stockholm/makefu/2configs/opentracker.nix> + ## network <stockholm/makefu/2configs/vpn/openvpn-server.nix> # <stockholm/makefu/2configs/vpn/vpnws/server.nix> @@ -151,6 +135,8 @@ in { <stockholm/makefu/2configs/deployment/graphs.nix> <stockholm/makefu/2configs/deployment/owncloud.nix> <stockholm/makefu/2configs/deployment/boot-euer.nix> + <stockholm/makefu/2configs/shiori.nix> + <stockholm/makefu/2configs/bgt/download.binaergewitter.de.nix> <stockholm/makefu/2configs/bgt/hidden_service.nix> <stockholm/makefu/2configs/bgt/backup.nix> @@ -159,6 +145,11 @@ in { # sharing <stockholm/makefu/2configs/dcpp/airdcpp.nix> + { krebs.airdcpp.dcpp.shares = { + download.path = config.makefu.dl-dir + "/finished"; + sorted.path = config.makefu.dl-dir + "/sorted"; + }; + } <stockholm/makefu/2configs/dcpp/hub.nix> ## Temporary: diff --git a/makefu/1systems/gum/hardware-config.nix b/makefu/1systems/gum/hardware-config.nix index e49b621e7..2d7efe9cf 100644 --- a/makefu/1systems/gum/hardware-config.nix +++ b/makefu/1systems/gum/hardware-config.nix @@ -69,6 +69,11 @@ in { fsType = "ext4"; options = [ "nofail" ]; }; + fileSystems."/var/www/o.euer.krebsco.de" = { + device = "/dev/nixos/nextcloud"; + fsType = "ext4"; + options = [ "nofail" ]; + }; fileSystems."/var/lib/borgbackup" = { device = "/dev/nixos/backup"; fsType = "ext4"; diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index ac2677b7f..9b9b91a6f 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -11,6 +11,7 @@ in { ./hw/omo.nix #./hw/tsp.nix <stockholm/makefu> + { environment.systemPackages = with pkgs;[ tmux picocom ];} <stockholm/makefu/2configs/support-nixos.nix> <stockholm/makefu/2configs/zsh-user.nix> <stockholm/makefu/2configs/backup/state.nix> diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index ad7fc825c..3306279b9 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -47,7 +47,8 @@ in { <stockholm/makefu/2configs/bureautomation> # new hass entry point <stockholm/makefu/2configs/bureautomation/led-fader.nix> - # <stockholm/makefu/2configs/bureautomation/mpd.nix> #mpd is only used for TTS + # <stockholm/makefu/2configs/bureautomation/visitor-photostore.nix> + # <stockholm/makefu/2configs/bureautomation/mpd.nix> #mpd is only used for TTS, this is the web interface <stockholm/makefu/2configs/mqtt.nix> (let collectd-port = 25826; @@ -146,10 +147,8 @@ in { # rt2870.bin wifi card, part of linux-unfree hardware.enableAllFirmware = true; nixpkgs.config.allowUnfree = true; - networking.wireless.enable = true; # rt2870 with nonfree creates wlp2s0 from wlp0s20u2 # not explicitly setting the interface results in wpa_supplicant to crash - networking.wireless.interfaces = [ "wlp2s0" ]; networking.interfaces.virbr1.ipv4.addresses = [{ address = "10.8.8.11"; prefixLength = 24; @@ -161,8 +160,8 @@ in { hardware.cpu.intel.updateMicrocode = true; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.kernelModules = [ "kvm-intel" - "snd-seq" "snd-rawmidi" + boot.kernelModules = [ + "kvm-intel" "snd-seq" "snd-rawmidi" ]; fileSystems = { "/" = { diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 32a548954..ad9a3324b 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -15,6 +15,7 @@ <stockholm/makefu/2configs/main-laptop.nix> <stockholm/makefu/2configs/extra-fonts.nix> + <stockholm/makefu/2configs/editor/neovim> <stockholm/makefu/2configs/tools/all.nix> { programs.adb.enable = true; } @@ -58,6 +59,7 @@ # Krebs <stockholm/makefu/2configs/tinc/retiolum.nix> # <stockholm/makefu/2configs/share/gum-client.nix> + # <stockholm/makefu/2configs/share/temp-share-samba.nix> # applications @@ -68,7 +70,7 @@ # Virtualization # <stockholm/makefu/2configs/virtualisation/libvirt.nix> - # <stockholm/makefu/2configs/virtualisation/docker.nix> + <stockholm/makefu/2configs/virtualisation/docker.nix> <stockholm/makefu/2configs/virtualisation/virtualbox.nix> #{ # networking.firewall.allowedTCPPorts = [ 8080 ]; @@ -189,6 +191,7 @@ "/home/makefu/.imapfilter" "/home/makefu/.mutt" "/home/makefu/docs" + "/home/makefu/notes" "/home/makefu/.password-store" "/home/makefu/.secrets-pass" "/home/makefu/.config/syncthing" @@ -198,4 +201,11 @@ services.syncthing.dataDir = lib.mkForce "/home/makefu/.config/syncthing/"; # latest kernel (5.0) has issues with wifi card boot.kernelPackages = pkgs.linuxPackages; + # Bugfix for wifi card + powerManagement.resumeCommands = '' + sleep 2 + echo 1 > /sys/bus/pci/devices/0000:03:00.0/remove + sleep 3 + echo 1 > /sys/bus/pci/rescan + ''; } diff --git a/makefu/2configs/bgt/download.binaergewitter.de.nix b/makefu/2configs/bgt/download.binaergewitter.de.nix index f223081e9..77c9ddc81 100644 --- a/makefu/2configs/bgt/download.binaergewitter.de.nix +++ b/makefu/2configs/bgt/download.binaergewitter.de.nix @@ -37,6 +37,11 @@ in { ''; }; services.nginx = { + appendHttpConfig = '' + types { + audio/ogg oga ogg opus; + } + ''; enable = lib.mkDefault true; recommendedGzipSettings = true; recommendedOptimisation = true; diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix index 007f6064a..b9aa710c3 100644 --- a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix +++ b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix @@ -34,18 +34,18 @@ } { alias = "Turn off Fernseher after last in group left"; trigger = [ - { # trigger when movement was detected at the time - platform = "state"; - entity_id = "group.team"; - from = "home"; - to = "not_home"; - } - { # trigger at 18:00 no matter what - # to avoid 'everybody left before 18:00:00' - platform = "time"; - at = "18:00:00"; - } - ]; + { # trigger when movement was detected at the time + platform = "state"; + entity_id = "group.team"; + from = "home"; + to = "not_home"; + } + { # trigger at 18:00 no matter what + # to avoid 'everybody left before 18:00:00' + platform = "time"; + at = "18:00:00"; + } + ]; action = [ { service = "homeassistant.turn_off"; @@ -58,7 +58,7 @@ } { service = "notify.telegrambot"; - data = { + data_template = { title = "Bureau Shutdown"; message = "All devices are turned off due to {{ trigger.platform }}"; }; diff --git a/makefu/2configs/bureautomation/camera/comic.nix b/makefu/2configs/bureautomation/camera/comic.nix new file mode 100644 index 000000000..a847b0add --- /dev/null +++ b/makefu/2configs/bureautomation/camera/comic.nix @@ -0,0 +1,6 @@ +[ + { name = "Poorly Drawn Lines"; + platform = "generic"; + still_image_url = http://127.0.0.1:8123/local/lines.png ; + } +] diff --git a/makefu/2configs/bureautomation/comic-updater.nix b/makefu/2configs/bureautomation/comic-updater.nix new file mode 100644 index 000000000..5f26bc2c7 --- /dev/null +++ b/makefu/2configs/bureautomation/comic-updater.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, buildPythonPackage, ... }: + +let + mq = "192.168.8.11"; + pkg = pkgs.ampel; +in { + systemd.services.comic-updater = { + startAt = "daily"; + description = "Send led change to message queue"; + after = [ "network-online.target" ] ++ (lib.optional config.services.mosquitto.enable "mosquitto.service"); + path = with pkgs; [ wget xmlstarlet ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + User = "hass"; + WorkingDirectory = config.services.home-assistant.configDir; + ExecStart = pkgs.writeDash "update-poorly-drawn-lines" '' + set -euf + mkdir -p www/ + cd www/ + pic=$(wget -O- http://www.poorlydrawnlines.com/feed/ \ + | xml sel -t -v '/rss/channel/item/content:encoded' \ + | head -n 2 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' ) + wget "$pic" -nc && cp -v "$(basename "$pic")" lines.png + ''; + PrivateTmp = true; + }; + }; +} diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index 8ec9dacc2..d745d894a 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -1,12 +1,14 @@ { config, pkgs, lib, ... }: let kodi-host = "192.168.8.11"; - ten_hours = import ./combination/10h_timers.nix { inherit lib; }; # provides: timer automation script - mittagessen = import ./combination/mittagessen.nix { inherit lib; }; # provides: automation script - matrix = import ./combination/matrix.nix { inherit lib; }; # provides: matrix automation + 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 in { imports = [ ./ota.nix + ./comic-updater.nix ]; networking.firewall.allowedTCPPorts = [ 8123 ]; state = [ "/var/lib/hass/known_devices.yaml" ]; @@ -113,7 +115,8 @@ in { ]; binary_sensor = (import ./binary_sensor/buttons.nix) ++ - (import ./binary_sensor/motion.nix); + (import ./binary_sensor/motion.nix) ++ + aramark.binary_sensor; sensor = [{ platform = "version"; }] ++ @@ -122,10 +125,12 @@ in { (import ./sensor/airquality.nix) ++ ((import ./sensor/outside.nix) {inherit lib;}) ++ (import ./sensor/influxdb.nix) ++ - (import ./sensor/tasmota_firmware.nix); + (import ./sensor/tasmota_firmware.nix) ++ + aramark.sensor; camera = - (import ./camera/verkehrskamera.nix); + (import ./camera/verkehrskamera.nix) + ++ (import ./camera/comic.nix); # not yet released #person = @@ -174,6 +179,7 @@ in { "group.team" "group.nachtlicht" "group.switches" + "group.aramark" ]; }; automation = []; @@ -195,7 +201,6 @@ in { "device_tracker.carsten_phone" "device_tracker.thierry_phone" "device_tracker.frank_phone" - "device_tracker.anthony_phone" # "person.thorsten" # "person.felix" # "person.ecki" @@ -205,6 +210,7 @@ in { "camera.Baumarkt" "camera.Autobahn_Heilbronn" "camera.Autobahn_Singen" + "camera.poorly_drawn_lines" ]; nachtlicht = [ "switch.nachtlicht_a" @@ -212,6 +218,21 @@ in { "switch.nachtlicht_c" "switch.nachtlicht_d" ]; + Aramark = [ + "binary_sensor.pommes" + "sensor.menu_1" + "sensor.menu_1_text" + "sensor.menu_1_preis" + "sensor.menu_2" + "sensor.menu_2_text" + "sensor.menu_2_preis" + "sensor.aktion" + "sensor.aktion_text" + "sensor.aktion_preis" + "sensor.mercato" + "sensor.mercato_text" + "sensor.mercato_preis" + ]; sensors = [ "media_player.kodi" "script.blitz_10s" @@ -221,6 +242,7 @@ in { "sensor.easy2_dht22_humidity" "sensor.easy2_dht22_temperature" "sensor.air_quality" + # "binary_sensor.aramark_pommes" # "binary_sensor.redbutton" ]; outside = [ diff --git a/makefu/2configs/bureautomation/lib/scripts.nix b/makefu/2configs/bureautomation/lib/scripts.nix new file mode 100644 index 000000000..d8665f94f --- /dev/null +++ b/makefu/2configs/bureautomation/lib/scripts.nix @@ -0,0 +1,18 @@ +{ lib, ... }: +{ + multi_flash = { entity, delays ? [ 500 ], alias ? "${entity}_multi_flash_${toString (lib.length delays)}" }: + { + inherit alias; + sequence = lib.flatten (builtins.map (delay: [ + { service = "homeassistant.turn_on"; + data.entity_id = entity; + } + { delay.milliseconds = delay; } + { service = "homeassistant.turn_off"; + data.entity_id = entity; + } + { delay.milliseconds = delay; } + ] + ) delays); + }; +} diff --git a/makefu/2configs/bureautomation/combination/10h_timers.nix b/makefu/2configs/bureautomation/multi/10h_timers.nix index dec5347a6..53bfd3725 100644 --- a/makefu/2configs/bureautomation/combination/10h_timers.nix +++ b/makefu/2configs/bureautomation/multi/10h_timers.nix @@ -1,7 +1,6 @@ {lib, ... }: let - persons = [ "frank" "daniel" "thorsten" "carsten" "thierry" "ecki" "felix" - "anthony" # antony + persons = [ "frank" "daniel" "thorsten" "carsten" "ecki" "felix" "thierry" # tjeri ]; random_zu_lange = name: ''{{ [ @@ -45,7 +44,7 @@ let "Im Kalender von ${name} sind heute acht Meetings eingeplant, von denen zwei bereits verpasst wurden", "Das Postfach von ${name} beinhaltet einhundertachtundzwanzig ungelesene E-Mails.", "Nachricht von Serge: ${name}, bitte melden Sie sich Umgehend bei mir im Büro!", - "Luftqualität hat sich durch das Eintreffen von ${name} um zweihunder Punkte verschlechtert, bitte alle Fenster öffnen.", + "Luftqualität hat sich durch das Eintreffen von ${name} um zweihundert Punkte verschlechtert, bitte alle Fenster öffnen.", "Die Tür geht auf, wer mag das sein? Schon schreitet hier der ${name} ein. Das Volk, es jubelt, Dirnen schmachten. Fürs Festmahl beginnt man schon zu schlachten. Er wird nur nach dem besten streben! Der ${name}, er soll lange leben!", "${name} arbeitet gern für seinen Konzern", "${name} ist nur froh im Großraumbüro", @@ -147,8 +146,8 @@ let entity_id = [ "timer.${name}_10h" ] ; } { service = "homeassistant.turn_on"; - entity_id = [ - # "script.buzz_${name}" + entity_id = [ + "switch.fernseher" "script.blitz_10s" "script.announce_${name}" ]; diff --git a/makefu/2configs/bureautomation/combination/README.md b/makefu/2configs/bureautomation/multi/README.md index baad87fda..baad87fda 100644 --- a/makefu/2configs/bureautomation/combination/README.md +++ b/makefu/2configs/bureautomation/multi/README.md diff --git a/makefu/2configs/bureautomation/multi/aramark.nix b/makefu/2configs/bureautomation/multi/aramark.nix new file mode 100644 index 000000000..ebe2cde81 --- /dev/null +++ b/makefu/2configs/bureautomation/multi/aramark.nix @@ -0,0 +1,24 @@ +{ lib, ... }: +let + aramark = topic: name: + { platform = "mqtt"; + inherit name; + state_topic = "/aramark/thales-deutschland/${topic}"; + }; + aramark_menue = menue: + [ + (aramark "${menue}/title" menue) + (aramark "${menue}/description" "${menue} Text") + ((aramark "${menue}/price" "${menue} Preis") // { unit_of_measurement = "€"; }) + ]; +in +{ + sensor = (aramark_menue "Menü 1") + ++ (aramark_menue "Menü 2") + ++ (aramark_menue "Mercato") + ++ (aramark_menue "Aktion"); + binary_sensor = + [ + ((aramark "pommes" "Pommes" ) // { payload_on = "True"; payload_off = "False"; }) + ]; +} diff --git a/makefu/2configs/bureautomation/combination/matrix.nix b/makefu/2configs/bureautomation/multi/matrix.nix index 85ba31986..85ba31986 100644 --- a/makefu/2configs/bureautomation/combination/matrix.nix +++ b/makefu/2configs/bureautomation/multi/matrix.nix diff --git a/makefu/2configs/bureautomation/combination/mittagessen.nix b/makefu/2configs/bureautomation/multi/mittagessen.nix index 3ec70998d..3ec70998d 100644 --- a/makefu/2configs/bureautomation/combination/mittagessen.nix +++ b/makefu/2configs/bureautomation/multi/mittagessen.nix diff --git a/makefu/2configs/bureautomation/visitor-photostore.nix b/makefu/2configs/bureautomation/visitor-photostore.nix new file mode 100644 index 000000000..762226549 --- /dev/null +++ b/makefu/2configs/bureautomation/visitor-photostore.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: +# more than just nginx config but not enough to become a module +let + wsgi-sock = "${workdir}/uwsgi-photostore.sock"; + workdir = config.services.uwsgi.runDir; + wifi-itf = "wlp2s0"; + wifi-ip = "172.16.9.96"; +in { + + services.uwsgi = { + enable = true; + user = "nginx"; + runDir = "/var/lib/photostore"; + plugins = [ "python3" ]; + instance = { + type = "emperor"; + vassals = { + cameraupload-server = { + type = "normal"; + pythonPackages = self: with self; [ pkgs.cameraupload-server ]; + socket = wsgi-sock; + }; + }; + }; + }; + + services.nginx = { + enable = lib.mkDefault true; + virtualHosts.${wifi-ip} = { + locations = { + "/".extraConfig = '' + expires -1; + uwsgi_pass unix://${wsgi-sock}; + uwsgi_param UWSGI_CHDIR ${workdir}; + uwsgi_param UWSGI_MODULE cuserver.main; + uwsgi_param UWSGI_CALLABLE app; + include ${pkgs.nginx}/conf/uwsgi_params; + ''; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ 80 ]; +# networking.interfaces.${wifi-itf}.ipv4.addresses = [{ |