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; recommendedProxySettings = true;
virtualHosts = { virtualHosts = {
"iot.pepe.private" = { "iot.pepe.private" = {
serverAliases = [ serverAliases = [ "hass.pepe.private" "home.pepe.private" ];
"hass.pepe.private" locations."/" = { proxyPass = "http://pepe.private:8123"; };
"home.pepe.private"
];
locations."/" = {
proxyPass = "http://pepe.private:8123";
};
}; };
}; };
}; };

View File

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

View File

@ -1,48 +1,48 @@
{ pkgs, config, lib, ... }: { 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 { in {
services.homeAssistantConfig = let imports = [ ./mqtt.nix ];
sonoffSwitches = { services.homeAssistantConfig = {
"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 {
homeassistant = { homeassistant = {
customize = lib.mapAttrs' (entity: value: { customize = lib.mapAttrs' (entity: value: {
@ -74,15 +74,20 @@ in {
}]; }];
group = { 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" ]; }; living_room = { entities = builtins.map toSwitch [ "pal03" "pal04" ]; };
tv = { entities = builtins.map toSwitch [ "pal05" ]; }; tv = { entities = builtins.map toSwitch [ "pal05" ]; };
kitchen = { entities = builtins.map toSwitch [ "pal06" ]; }; kitchen = { entities = builtins.map toSwitch [ "pal06" ]; };
unknown = { unknown = { entities = builtins.map toSwitch [ "pal07" "pal08" ]; };
entities = builtins.map toSwitch [ "pal07" "pal08" ];
};
all_lights = { 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 = { services.nginx = {
enable = true; enable = true;

View File

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