From d2f33997e7d2bcb3eb692d60f963f8f43d5742e8 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 28 Mar 2021 09:40:54 +0200 Subject: [PATCH] home-assistant working --- configs/pepe/home-assistant.nix | 8 +++++--- system/server/default.nix | 13 ++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index c6146c3..97abf1a 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -38,9 +38,8 @@ in { type = "trusted_networks"; trusted_networks = [ config.module.cluster.services.tinc."private".networkSubnet - # lan network - "10.1.0.0/24" "192.168.178.0/24" + "127.0.0.1" ]; }]; @@ -285,7 +284,10 @@ in { virtualHosts = { "iot.pepe.private" = { serverAliases = [ "hass.pepe.private" "home.pepe.private" ]; - locations."/" = { proxyPass = "http://pepe.private:8123"; }; + locations."/" = { + proxyWebsockets = true; + proxyPass = "http://localhost:8123"; + }; }; }; }; diff --git a/system/server/default.nix b/system/server/default.nix index f85e232..61f0a63 100644 --- a/system/server/default.nix +++ b/system/server/default.nix @@ -18,7 +18,18 @@ programs.custom.vim.enable = true; # no need to to start a service - environment.systemPackages = [ pkgs.mosh ]; + environment.systemPackages = let + + nginxShowConfig = pkgs.writers.writePython3Bin "nginx-show-config" { + flakeIgnore = [ "E265" "E225" "W292" ]; + } (lib.fileContents ); + in [ + pkgs.mosh + + # nginxfmt + pkgs.nginx-config-formatter + nginxShowConfig + ]; }