From cfd245c3e4b40389f330e9cec9ce1388e1a23e9a Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Thu, 13 Oct 2022 00:19:18 +0200 Subject: [PATCH 1/4] WIP home-assistant on loki --- loki/configuration.nix | 73 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/loki/configuration.nix b/loki/configuration.nix index 4cb13de..b42ba3c 100644 --- a/loki/configuration.nix +++ b/loki/configuration.nix @@ -386,16 +386,75 @@ with lib; { # virtualbox.host.enable = true; oci-containers.containers = { - hass = { - image = "ghcr.io/home-assistant/home-assistant:stable"; - environment = { TZ = "Europe/Rome"; }; - extraOptions = [ "--privileged" "--network=host" "--pull=always" ]; - ports = [ "8123:8123" ]; - volumes = [ "/var/lib/hass:/config" "/mnt/raid0/condiviso:/media" ]; - }; + # hass = { + # image = "ghcr.io/home-assistant/home-assistant:stable"; + # environment = { TZ = "Europe/Rome"; }; + # extraOptions = [ "--privileged" "--network=host" "--pull=always" ]; + # ports = [ "8123:8123" ]; + # volumes = [ "/var/lib/hass:/config" "/mnt/raid0/condiviso:/media" ]; + # }; }; }; + services.home-assistant = { + enable = true; + openFirewall = true; + extraComponents = [ + # "accuweather" + "alert" + "analytics" + "automation" + "bayesian" + "binary_sensor" + "blueprint" + # "bluetooth_le_tracker" + # "bluetooth_tracker" + "button" + "camera" + # "cast" + # "citybikes" + "conf" + "configurator" + "coronavirus" + "counter" + "cover" + "default_config" + "derivative" + "device_automation" + "device_sun_light_trigger" + "device_tracker" + "dhcp" + # "dlib_face_detect" + # "dlib_face_identify" + # "esphome" + # "flux" + "group" + "hassio" + "input_boolean" + "input_button" + "input_datetime" + "input_number" + "input_select" + "input_text" + # "meteoalarm" + "ping" + "proximity" + "random" + "schedule" + "script" + "tcp" + "template" + "threshold" + "timer" + "tod" # times of the day + "trend" + "upnp" + "workday" + "zeroconf" + # "zoneminder" + ]; + }; + security.sudo.extraConfig = '' Defaults pwfeedback ''; From 8a859f17dea3813c327399feb71822e7ef075499 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 11 Nov 2022 14:37:10 +0100 Subject: [PATCH 2/4] Switch to unstable zerotier --- nixos_modules/zerotier.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos_modules/zerotier.nix b/nixos_modules/zerotier.nix index 7039517..a70c135 100644 --- a/nixos_modules/zerotier.nix +++ b/nixos_modules/zerotier.nix @@ -1,6 +1,7 @@ -{ +{ pkgs, ... }: { services.zerotierone = { enable = true; + package = pkgs.unstable.zerotierone; joinNetworks = [ "8056c2e21cf9c753" ]; }; } From bb52b4205181d800509d9f38e7be744b3dff146c Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 11 Nov 2022 14:37:52 +0100 Subject: [PATCH 3/4] Update home-asstant configuration loki --- loki/configuration.nix | 57 ++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/loki/configuration.nix b/loki/configuration.nix index b42ba3c..dd756de 100644 --- a/loki/configuration.nix +++ b/loki/configuration.nix @@ -22,7 +22,7 @@ with lib; { hardware = { enableRedistributableFirmware = true; - nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + # nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; # nvidia.nvidiaPersistenced = true; # HEADLESS # nvidia.prime = { # offload.enable = false; @@ -209,7 +209,7 @@ with lib; { }; xserver = { # enable = true; - videoDrivers = [ "nvidia" ]; + # videoDrivers = [ "nvidia" ]; # layout = "it"; # xkbOptions = "eurosign:e;"; # libinput.enable = true; @@ -398,12 +398,29 @@ with lib; { services.home-assistant = { enable = true; - openFirewall = true; + # package = pkgs.unstable.home-assistant; + # openFirewall = true; + # config = { + # default_config = { }; + # name = "Casa"; + # latitude = 45.05197317019396; + # longitude = 11.653331816196443; + # elevation = 17; + # unit_system = "metric"; + # time_zone = "Europe/Rome"; + # }; + config = null; + configDir = "/var/lib/hass"; + configWritable = true; extraComponents = [ - # "accuweather" + "default_config" + + + "accuweather" "alert" "analytics" "automation" + "backup" "bayesian" "binary_sensor" "blueprint" @@ -411,9 +428,9 @@ with lib; { # "bluetooth_tracker" "button" "camera" - # "cast" - # "citybikes" - "conf" + "cast" + "citybikes" + "config" "configurator" "coronavirus" "counter" @@ -424,10 +441,12 @@ with lib; { "device_sun_light_trigger" "device_tracker" "dhcp" - # "dlib_face_detect" - # "dlib_face_identify" - # "esphome" - # "flux" + "dlib_face_detect" + "dlib_face_identify" + "dlna_dmr" + "dlna_dms" + "esphome" + "flux" "group" "hassio" "input_boolean" @@ -436,12 +455,24 @@ with lib; { "input_number" "input_select" "input_text" + "jellyfin" + "local_file" + "media_player" + "met" # "meteoalarm" + "mobile_app" + "network" + "notify" "ping" + "plex" "proximity" + "radarr" + "radio_browser" "random" - "schedule" + # "schedule" "script" + "sonarr" + # "spotify" "tcp" "template" "threshold" @@ -451,7 +482,7 @@ with lib; { "upnp" "workday" "zeroconf" - # "zoneminder" + "zoneminder" ]; }; From a766b73a5919941ea17800eb0d2377086a47b0aa Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 11 Nov 2022 14:41:12 +0100 Subject: [PATCH 4/4] Update lock --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index b17a07b..0d7ddf7 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1665996265, - "narHash": "sha256-/k9og6LDBQwT+f/tJ5ClcWiUl8kCX5m6ognhsAxOiCY=", + "lastModified": 1667907331, + "narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=", "owner": "nix-community", "repo": "home-manager", - "rev": "b81e128fc053ab3159d7b464d9b7dedc9d6a6891", + "rev": "6639e3a837fc5deb6f99554072789724997bc8e5", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1666873549, - "narHash": "sha256-a6Eu1Qv/EndjepSMja5SvcG+4vM5Rl2gzJD7xscRHss=", + "lastModified": 1668157555, + "narHash": "sha256-s5rt2FSmV4PWt89rjt4cvBGOhPizStsinkIB0BXnKrk=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "419dcc0ec767803182ed01a326f134230578bf60", + "rev": "062c3cca468a4b404ddd964fb444b665e4da982e", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1666961615, - "narHash": "sha256-+Sqz6zQA85Q14U/KwsJO386oxd47zDte8dqBGOtRJGg=", + "lastModified": 1668163658, + "narHash": "sha256-sOVWRdSx9fTIKvHxglj+rZQLhPNR3yf8VERJjaLfioE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "040c6d8374d090f46ab0e99f1f7c27a4529ecffd", + "rev": "37e9b04dd221eb11b6de8727e37ed55c7dbdfb6f", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-u": { "locked": { - "lastModified": 1666959691, - "narHash": "sha256-TRpWA3t8ata79HOGtFd5dDCl1kJQmIE16PDF53/Hcxo=", + "lastModified": 1667991831, + "narHash": "sha256-DHgEsLZI044B9T4AjA3K6+yB9/DqLr4dyA7OIx0FG7o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "448a599c49978c2794401bfc3a2e1fba1a8663be", + "rev": "872fceeed60ae6b7766cc0a4cd5bf5901b9098ec", "type": "github" }, "original": { @@ -142,11 +142,11 @@ ] }, "locked": { - "lastModified": 1666604592, - "narHash": "sha256-Bxy7xeVAwC0yxFaeYZM7N9Us/ebxpMC9TCceKEFeay4=", + "lastModified": 1667992213, + "narHash": "sha256-8Ens8ozllvlaFMCZBxg6S7oUyynYx2v7yleC5M0jJsE=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "1b436f36e2812c589e6d830e3223059ea9661100", + "rev": "ebcbfe09d2bd6d15f68de3a0ebb1e4dcb5cd324b", "type": "github" }, "original": {