feature/hass
Ingolf Wagner 2020-04-09 16:51:39 +02:00
parent 4df3c4ae8c
commit 239821b59d
Signed by: palo
GPG Key ID: 76BF5F1928B9618B
5 changed files with 55 additions and 58 deletions

View File

@ -216,13 +216,8 @@ in {
recommendedProxySettings = true;
virtualHosts = {
"iot.pepe.private" = {
serverAliases = [
"hass.pepe.private"
"home.pepe.private"
];
locations."/" = {
proxyPass = "http://pepe.private:8123";
};
serverAliases = [ "hass.pepe.private" "home.pepe.private" ];
locations."/" = { proxyPass = "http://pepe.private:8123"; };
};
};
};

View File

@ -1,8 +1,7 @@
{ lib, ... }:
{
{ lib, ... }: {
services.homeAssistantConfig.mqtt = {
# discovery = false;
# discovery = false;
# for mosquitto
broker = "127.0.0.1";
username = lib.fileContents <secrets/home-assistant/mqtt-user>;

View File

@ -1,48 +1,48 @@
{ pkgs, config, lib, ... }:
let
sonoffSwitches = {
"pal01" = {
label = "Schlafzimmer";
icon = "mdi:lightbulb-on";
};
"pal02" = {
label = "Schlafzimmer";
icon = "mdi:lightbulb-on";
};
"pal03" = {
label = "Wohnzimmer";
icon = "mdi:lightbulb-on";
};
"pal04" = {
label = "Wohnzimmer";
icon = "mdi:lightbulb-on";
};
"pal05" = {
label = "TV";
icon = "mdi:television";
};
"pal06" = {
label = "Küche";
icon = "mdi:lightbulb-on";
};
"pal07" = {
label = "Nummer 7";
icon = "mdi:power-plug-off";
};
"pal08" = {
label = "Nummer 8";
icon = "mdi:power-plug-off";
};
};
toSwitch = name: "switch.${name}";
let unstablePkgs = import <nixpkgs-unstable> { };
in {
services.homeAssistantConfig = let
imports = [ ./mqtt.nix ];
sonoffSwitches = {
"pal01" = {
label = "Schlafzimmer";
icon = "mdi:lightbulb-on";
};
"pal02" = {
label = "Schlafzimmer";
icon = "mdi:lightbulb-on";
};
"pal03" = {
label = "Wohnzimmer";
icon = "mdi:lightbulb-on";
};
"pal04" = {
label = "Wohnzimmer";
icon = "mdi:lightbulb-on";
};
"pal05" = {
label = "TV";
icon = "mdi:television";
};
"pal06" = {
label = "Küche";
icon = "mdi:lightbulb-on";
};
"pal07" = {
label = "Nummer 7";
icon = "mdi:power-plug-off";
};
"pal08" = {
label = "Nummer 8";
icon = "mdi:power-plug-off";
};
};
toSwitch = name: "switch.${name}";
in {
services.homeAssistantConfig = {
homeassistant = {
customize = lib.mapAttrs' (entity: value: {
@ -74,15 +74,20 @@ in {
}];
group = {
bed_room = { entities = builtins.map toSwitch [ "pal01" "pal02"]; };
bed_room = { entities = builtins.map toSwitch [ "pal01" "pal02" ]; };
living_room = { entities = builtins.map toSwitch [ "pal03" "pal04" ]; };
tv = { entities = builtins.map toSwitch [ "pal05" ]; };
kitchen = { entities = builtins.map toSwitch [ "pal06" ]; };
unknown = {
entities = builtins.map toSwitch [ "pal07" "pal08" ];
};
unknown = { entities = builtins.map toSwitch [ "pal07" "pal08" ]; };
all_lights = {
entities = builtins.map toSwitch [ "pal01" "pal02" "pal03" "pal04" "pal05" "pal06" ];
entities = builtins.map toSwitch [
"pal01"
"pal02"
"pal03"
"pal04"
"pal05"
"pal06"
];
};
};

View File

@ -28,8 +28,7 @@ let
};
};
in
{
in {
services.nginx = {
enable = true;

View File

@ -25,7 +25,6 @@ in {
networking.wireless.enable = true;
networking.wireless.networks."ssid".psk = "password";
# configuration
environment.extraInit = ''
# use vi shortcuts