This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

l hass: use as docker container

+10 -93
+10 -93
nixos/2configs/hass/default.nix
··· 1 1 { config, lib, pkgs, ... }: 2 - with import ./lib.nix { inherit lib; }; 3 - let 4 - dwdwfsapi = pkgs.python3Packages.buildPythonPackage rec { 5 - pname = "dwdwfsapi"; 6 - version = "1.0.3"; 7 - 8 - src = pkgs.python3Packages.fetchPypi { 9 - inherit pname version; 10 - sha256 = "0fcv79xiq0qr4kivhd68iqpgrsjc7djxqs2h543pyr0sdgb5nz9x"; 11 - }; 12 - 13 - buildInputs = with pkgs.python3Packages; [ 14 - requests ciso8601 15 - ]; 16 - 17 - # LC_ALL = "en_US.UTF-8"; 18 - }; 19 - 20 - in { 2 + { 21 3 imports = [ 22 4 ./pyscript 23 5 ./zigbee.nix ··· 36 18 { predicate = "-i wiregrill -p tcp --dport 8123"; target = "ACCEPT"; } # hass 37 19 ]; 38 20 39 - 40 - services.home-assistant = { 41 - enable = true; 42 - configWritable = true; 43 - lovelaceConfigWritable = true; 44 - config = let 45 - tasmota = name: topic: { 46 - inherit name; 47 - state_topic = "stat/${topic}/POWER"; 48 - command_topic = "cmnd/${topic}/POWER"; 49 - payload_on = "ON"; 50 - payload_off = "OFF"; 51 - }; 52 - in { 53 - homeassistant = { 54 - name = "Home"; 55 - time_zone = "Europe/Berlin"; 56 - latitude = "52.46187"; 57 - longitude = "13.41489"; 58 - elevation = 90; 59 - unit_system = "metric"; 60 - # customize = friendly_names; 61 - }; 62 - config = {}; 63 - sun.elevation = 66; 64 - shopping_list = {}; 65 - discovery = {}; 66 - frontend = {}; 67 - http = {}; 68 - # mqtt = { 69 - # broker = "localhost"; 70 - # port = 1883; 71 - # client_id = "home-assistant"; 72 - # username = "gg23"; 73 - # password = "gg23-mqtt"; 74 - # keepalive = 60; 75 - # protocol = 3.1; 76 - 77 - # discovery = true; 78 - # birth_message = { 79 - # topic = "/hass/status"; 80 - # payload = "online"; 81 - # }; 82 - # will_message = { 83 - # topic = "/hass/status"; 84 - # payload = "offline"; 85 - # }; 86 - # }; 87 - sensor = [ 88 - { 89 - platform = "dwd_weather_warnings"; 90 - region_name = "Berlin"; 91 - } 21 + # TODO add auto update 22 + virtualisation.oci-containers = { 23 + backend = "podman"; 24 + containers.homeassistant = { 25 + volumes = [ "home-assistant:/config" ]; 26 + environment.TZ = "Europe/Berlin"; 27 + image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated 28 + extraOptions = [ 29 + "--network=host" 92 30 ]; 93 - mqtt.switch = [ 94 - (tasmota "TV" "tv") 95 - (tasmota "Drucker Strom" "drucker") 96 - (tasmota "Waschmaschine" "wasch") 97 - (tasmota "Stereo Anlage" "stereo") 98 - (tasmota "Wohnzimmer Lampe" "wohn_lampe") 99 - ]; 100 - mobile_app = {}; 101 - weather = [ 102 - { 103 - platform = "openweathermap"; 104 - api_key = "XXX"; # TODO put into secrets 105 - } 106 - ]; 107 - system_health = {}; 108 - history = {}; 109 - shopping_list = {}; 110 - media_player = { 111 - platform = "snapcast"; 112 - host = "127.0.0.1"; 113 - }; 114 31 }; 115 32 }; 116 33