This commit is contained in:
Ingolf Wagner 2020-04-09 16:51:39 +02:00
parent 4df3c4ae8c
commit 239821b59d
No known key found for this signature in database
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,9 +1,5 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
let
let unstablePkgs = import <nixpkgs-unstable> { };
in {
services.homeAssistantConfig = let
sonoffSwitches = { sonoffSwitches = {
"pal01" = { "pal01" = {
@ -44,6 +40,10 @@ in {
in { in {
imports = [ ./mqtt.nix ];
services.homeAssistantConfig = {
homeassistant = { homeassistant = {
customize = lib.mapAttrs' (entity: value: { customize = lib.mapAttrs' (entity: value: {
name = toSwitch entity; name = toSwitch entity;
@ -78,11 +78,16 @@ in {
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