diff options
Diffstat (limited to 'lass')
-rw-r--r-- | lass/1systems/yellow/config.nix | 14 | ||||
-rw-r--r-- | lass/2configs/hass/default.nix | 158 | ||||
-rw-r--r-- | lass/5pkgs/tdlib-purple/default.nix | 4 |
3 files changed, 103 insertions, 73 deletions
diff --git a/lass/1systems/yellow/config.nix b/lass/1systems/yellow/config.nix index 1afad003c..178a5adf1 100644 --- a/lass/1systems/yellow/config.nix +++ b/lass/1systems/yellow/config.nix @@ -152,10 +152,11 @@ with import <stockholm/lib>; krebs.iptables = { enable = true; tables.filter.INPUT.rules = [ - { predicate = "-p tcp --dport 80"; target = "ACCEPT"; } - { predicate = "-p tcp --dport 9091"; target = "ACCEPT"; } - { predicate = "-p tcp --dport 51413"; target = "ACCEPT"; } - { predicate = "-p udp --dport 51413"; target = "ACCEPT"; } + { predicate = "-p tcp --dport 80"; target = "ACCEPT"; } # nginx web dir + { predicate = "-p tcp --dport 9091"; target = "ACCEPT"; } # transmission-web + { predicate = "-p tcp --dport 51413"; target = "ACCEPT"; } # transmission-traffic + { predicate = "-p udp --dport 51413"; target = "ACCEPT"; } # transmission-traffic + { predicate = "-p tcp --dport 8096"; target = "ACCEPT"; } # jellyfin ]; }; @@ -265,4 +266,9 @@ with import <stockholm/lib>; ''; }; }; + + services.jellyfin = { + enable = true; + group = "download"; + }; } diff --git a/lass/2configs/hass/default.nix b/lass/2configs/hass/default.nix index 3cd6e0ebf..7765db84e 100644 --- a/lass/2configs/hass/default.nix +++ b/lass/2configs/hass/default.nix @@ -1,7 +1,29 @@ { config, lib, pkgs, ... }: with import ./lib.nix { inherit lib; }; +let + unstable = import (pkgs.fetchFromGitHub { + owner = "nixos"; + repo = "nixpkgs"; + rev = (lib.importJSON ../../../krebs/nixpkgs-unstable.json).rev; + sha256 = (lib.importJSON ../../../krebs/nixpkgs-unstable.json).sha256; + }) {}; + dwdwfsapi = pkgs.python3Packages.buildPythonPackage rec { + pname = "dwdwfsapi"; + version = "1.0.3"; -{ + src = pkgs.python3Packages.fetchPypi { + inherit pname version; + sha256 = "0fcv79xiq0qr4kivhd68iqpgrsjc7djxqs2h543pyr0sdgb5nz9x"; + }; + + buildInputs = with pkgs.python3Packages; [ + requests ciso8601 + ]; + + # LC_ALL = "en_US.UTF-8"; + }; + +in { imports = [ ./zigbee.nix ./rooms/bett.nix @@ -21,78 +43,80 @@ with import ./lib.nix { inherit lib; }; services.home-assistant = { enable = true; - package = pkgs.home-assistant.override { - # extraComponents = [ "hue" ]; + package = (unstable.home-assistant.overrideAttrs (old: { + doInstallCheck = false; + })).override { + extraPackages = _: [ dwdwfsapi ]; }; configWritable = true; lovelaceConfigWritable = true; - }; - - services.home-assistant.config = let - tasmota_s20 = name: topic: { - platform = "mqtt"; - inherit name; - state_topic = "stat/${topic}/POWER"; - command_topic = "cmnd/${topic}/POWER"; - payload_on = "ON"; - payload_off = "OFF"; - }; - in { - homeassistant = { - name = "Home"; - time_zone = "Europe/Berlin"; - latitude = "52.46187"; - longitude = "13.41489"; - elevation = 90; - unit_system = "metric"; - customize = friendly_names; - }; - config = {}; - sun.elevation = 66; - shopping_list = {}; - discovery = {}; - frontend = {}; - mqtt = { - broker = "localhost"; - port = 1883; - client_id = "home-assistant"; - username = "gg23"; - password = "gg23-mqtt"; - keepalive = 60; - protocol = 3.1; - - discovery = true; - birth_message = { - topic = "/hass/status"; - payload = "online"; + config = let + tasmota_s20 = name: topic: { + platform = "mqtt"; + inherit name; + state_topic = "stat/${topic}/POWER"; + command_topic = "cmnd/${topic}/POWER"; + payload_on = "ON"; + payload_off = "OFF"; + }; + in { + homeassistant = { + name = "Home"; + time_zone = "Europe/Berlin"; + latitude = "52.46187"; + longitude = "13.41489"; + elevation = 90; + unit_system = "metric"; + customize = friendly_names; }; - will_message = { - topic = "/hass/status"; - payload = "offline"; + config = {}; + sun.elevation = 66; + shopping_list = {}; + discovery = {}; + frontend = {}; + http = {}; + mqtt = { + broker = "localhost"; + port = 1883; + client_id = "home-assistant"; + username = "gg23"; + password = "gg23-mqtt"; + keepalive = 60; + protocol = 3.1; + + discovery = true; + birth_message = { + topic = "/hass/status"; + payload = "online"; + }; + will_message = { + topic = "/hass/status"; + payload = "offline"; + }; }; + sensor = [ + { + platform = "dwd_weather_warnings"; + region_name = "Berlin"; + } + ]; + switch = [ + (tasmota_s20 "TV" "tv") + (tasmota_s20 "Drucker Strom" "drucker") + (tasmota_s20 "Waschmaschine" "wasch") + (tasmota_s20 "Stereo Anlage" "stereo") + ]; + mobile_app = {}; + weather = [ + { + platform = "openweathermap"; + api_key = "xxx"; # TODO put into secrets + } + ]; + system_health = {}; + history = {}; + shopping_list = {}; }; - sensor = [ - { - platform = "dwd_weather_warnings"; - region_name = "Berlin"; - } - ]; - switch = [ - (tasmota_s20 "TV" "tv") - (tasmota_s20 "Drucker Strom" "drucker") - (tasmota_s20 "Waschmaschine" "wasch") - (tasmota_s20 "Stereo Anlage" "stereo") - ]; - mobile_app = {}; - weather = [ - { - platform = "openweathermap"; - api_key = "xxx"; # TODO put into secrets - } - ]; - system_health = {}; - history = {}; - shopping_list = {}; }; services.mosquitto = { diff --git a/lass/5pkgs/tdlib-purple/default.nix b/lass/5pkgs/tdlib-purple/default.nix index 445839a4b..54841588e 100644 --- a/lass/5pkgs/tdlib-purple/default.nix +++ b/lass/5pkgs/tdlib-purple/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "tdlib-purple"; - version = "0.7.6"; + version = "0.7.8"; src = fetchFromGitHub { owner = "ars3niy"; repo = pname; rev = "v${version}"; - sha256 = "1inamfzbrz0sy4y431jgwjfg6lz14a7c71khrg02481raxchhzzf"; + sha256 = "17g54mcxsidcx37l6m4p8i06ln1hvq3347dhdl9xkkn7pqpwvv1c"; }; cmakeFlags = [ |