feat(rpi4): add home-assistant

This commit is contained in:
Felix Schröter 2020-10-03 16:32:06 +02:00
parent 358aa776c0
commit 806a3e23cf
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
2 changed files with 55 additions and 0 deletions

View file

@ -8,6 +8,7 @@
./system/i18n.nix
./services/jellyfin.nix
./modules/cfdyndns.nix
./services/home-assistant.nix
];
nixpkgs.config.allowUnfree = true;
@ -41,6 +42,26 @@
records = [ "home.felschr.com" ];
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"home.felschr.com" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:8123";
proxyWebsockets = true;
};
};
};
};
programs.zsh.enable = true;
services.openssh.enable = true;

View file

@ -0,0 +1,34 @@
{ config, pkgs, ... }:
with pkgs;
{
services.home-assistant = {
enable = true;
openFirewall = true;
config = {
homeassistant = {
name = "Home";
latitude = "!secret latitude";
longitude = "!secret longitude";
elevation = 0;
unit_system = "metric";
temperature_unit = "C";
external_url = "https://home.felschr.com";
internal_url = "http://192.168.86.233:8123";
};
default_config = {};
config = {};
frontend = {};
mobile_app = {};
discovery = {};
zeroconf = {};
ssdp = {};
shopping_list = {};
owntracks = {
mqtt_topic = "owntracks/#";
secret = "!secret owntracks_secret";
};
};
# configWritable = true; # doesn't work atm
};
}