summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/2configs/shack/glados/default.nix')
-rw-r--r--krebs/2configs/shack/glados/default.nix156
1 files changed, 27 insertions, 129 deletions
diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix
index 7c941a66a..236b5000d 100644
--- a/krebs/2configs/shack/glados/default.nix
+++ b/krebs/2configs/shack/glados/default.nix
@@ -1,12 +1,33 @@
{ config, pkgs, lib, ... }:
let
- unstable = import (pkgs.fetchFromGitHub {
- owner = "nixos";
- repo = "nixpkgs";
- rev = (lib.importJSON ../../../nixpkgs-unstable.json).rev;
- sha256 = (lib.importJSON ../../../nixpkgs-unstable.json).sha256;
- }) {};
+ kodi-host = "192.168.8.11";
+ confdir = "/var/lib/homeassistant-docker";
in {
+ imports = [
+ ];
+
+ # networking.firewall.allowedTCPPorts = [ 8123 ];
+ virtualisation.oci-containers.containers.hass = {
+ image = "homeassistant/home-assistant:latest";
+ environment = {
+ TZ = "Europe/Berlin";
+ # TODO create unique users
+ PUID = toString config.users.users.news_container.uid;
+ PGID = toString config.users.groups.news_container.gid;
+ UMASK = "007";
+ };
+ extraOptions = ["--net=host" ];
+ volumes = [
+ "${confdir}:/config"
+ #"${confdir}/docker-run:/etc/services.d/home-assistant/run:"
+ ];
+ };
+ systemd.tmpfiles.rules = [
+ #"f ${confdir}/docker-run 0770 kiosk kiosk - -"
+ # TODO:
+ "d ${confdir} 0770 news_container news_container - -"
+ ];
+
services.nginx.virtualHosts."hass.shack" = {
serverAliases = [ "glados.shack" ];
locations."/" = {
@@ -23,127 +44,4 @@ in {
'';
};
};
- imports = [
- ./multi/shackopen.nix
- ./multi/wasser.nix
- ./multi/schlechte_luft.nix
- ./multi/rollos.nix
-
- ./switch/power.nix
-
- ./sensors/power.nix
- ./sensors/mate.nix
- ./sensors/darksky.nix
- ./sensors/spaceapi.nix
- ./sensors/sensemap.nix
-
- ./automation/shack-startup.nix
- ./automation/party-time.nix
- ./automation/hass-restart.nix
- ./automation/ampel.nix
-
- ];
- services.home-assistant =
- {
- enable = true;
- package = unstable.home-assistant.overrideAttrs (old: {
- doInstallCheck = false;
- });
- config = {
- homeassistant = {
- name = "Glados";
- time_zone = "Europe/Berlin";
- latitude = "48.8265";
- longitude = "9.0676";
- elevation = 303;
- auth_providers = [
- { type = "homeassistant";}
- { type = "trusted_networks";
- trusted_networks = [
- "127.0.0.1/32"
- "10.42.0.0/16"
- "::1/128"
- "fd00::/8"
- ];
- }
- ];
- };
- # https://www.home-assistant.io/components/influxdb/
- influxdb = {
- database = "glados";
- host = "influx.shack";
- component_config_glob = {
- "sensor.*particulate_matter_2_5um_concentration".override_measurement = "2_5um particles";
- "sensor.*particulate_matter_10_0um_concentration".override_measurement ="10um particles";
- };
- tags = {
- instance = "wolf";
- source = "glados";
- };
- };
- esphome = {};
- api = {};
- mqtt = {
- broker = "localhost";
- port = 1883;
- client_id = "home-assistant";
- keepalive = 60;
- protocol = 3.1;
- discovery = true; #enable esphome discovery
- discovery_prefix = "homeassistant";
- birth_message = {
- topic = "glados/hass/status/LWT";
- payload = "Online";
- qos = 1;
- retain = true;
- };
- will_message = {
- topic = "glados/hass/status/LWT";
- payload = "Offline";
- qos = 1;
- retain = true;
- };
- };
- light = [];
- media_player = [
- { platform = "mpd";
- name = "lounge";
- host = "lounge.mpd.shack";
- }
- { platform = "mpd";
- name = "kiosk";
- #host = "lounge.kiosk.shack";
- host = "kiosk.shack";
- }
- ];
-
- camera = [];
- frontend = { };
- config = { };
- sun = {};
- http = {
- base_url = "http://hass.shack";
- use_x_forwarded_for = true;
- trusted_proxies = [ "127.0.0.1" "::1" ];
- };
- #conversation = {};
-
- history = {};
- logbook = {};
- #recorder = {};
-
- logger.default = "info";
-
- tts = [
- { platform = "google_translate";
- service_name = "say";
- language = "de";
- cache = true;
- time_memory = 57600;
- base_url = "http://hass.shack";
- }
- ];
- device_tracker = [];
- };
- };
}