mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
fix: fix routes to home assistant
This commit is contained in:
parent
6c731eede4
commit
b36e7e8202
4 changed files with 11 additions and 32 deletions
|
@ -93,6 +93,7 @@ in {
|
||||||
nodes.sentinel.config.networking.providedDomains.influxdb
|
nodes.sentinel.config.networking.providedDomains.influxdb
|
||||||
nodes.sentinel.config.networking.providedDomains.loki
|
nodes.sentinel.config.networking.providedDomains.loki
|
||||||
nodes.sentinel.config.networking.providedDomains.paperless
|
nodes.sentinel.config.networking.providedDomains.paperless
|
||||||
|
"home.${config.repo.secrets.global.domains.me}"
|
||||||
];
|
];
|
||||||
filters = [
|
filters = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
nodes,
|
nodes,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.repo.secrets.local) acme;
|
|
||||||
sentinelCfg = nodes.sentinel.config;
|
sentinelCfg = nodes.sentinel.config;
|
||||||
wardWebProxyCfg = nodes.ward-web-proxy.config;
|
wardWebProxyCfg = nodes.ward-web-proxy.config;
|
||||||
in {
|
in {
|
||||||
|
@ -30,17 +29,6 @@ in {
|
||||||
topology.self.hardware.info = "O-Droid N2+";
|
topology.self.hardware.info = "O-Droid N2+";
|
||||||
|
|
||||||
boot.mode = "efi";
|
boot.mode = "efi";
|
||||||
users.groups.acme.members = ["nginx"];
|
|
||||||
services.nginx.enable = true;
|
|
||||||
services.nginx.recommendedSetup = true;
|
|
||||||
|
|
||||||
security.acme = {
|
|
||||||
acceptTerms = true;
|
|
||||||
defaults = {
|
|
||||||
inherit (acme) email;
|
|
||||||
reloadServices = ["nginx"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
meta.promtail = {
|
meta.promtail = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
nodes,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
homeDomain = "home.${config.repo.secrets.global.domains.me}";
|
homeDomain = "home.${config.repo.secrets.global.domains.me}";
|
||||||
in {
|
in {
|
||||||
wireguard.proxy-home.firewallRuleForNode.ward.allowedTCPPorts = [
|
wireguard.proxy-home.firewallRuleForNode.ward-web-proxy.allowedTCPPorts = [
|
||||||
config.services.home-assistant.config.http.server_port
|
config.services.home-assistant.config.http.server_port
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ in {
|
||||||
server_host = ["0.0.0.0"];
|
server_host = ["0.0.0.0"];
|
||||||
server_port = 8123;
|
server_port = 8123;
|
||||||
use_x_forwarded_for = true;
|
use_x_forwarded_for = true;
|
||||||
trusted_proxies = ["127.0.0.1"];
|
trusted_proxies = [nodes.ward-web-proxy.config.wireguard.proxy-home.ipv4];
|
||||||
};
|
};
|
||||||
|
|
||||||
homeassistant = {
|
homeassistant = {
|
||||||
|
@ -82,7 +83,11 @@ in {
|
||||||
#themes = "!include_dir_merge_named themes";
|
#themes = "!include_dir_merge_named themes";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
extraPackages = python3Packages: with python3Packages; [psycopg2];
|
extraPackages = python3Packages:
|
||||||
|
with python3Packages; [
|
||||||
|
psycopg2
|
||||||
|
gtts
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
age.secrets."home-assistant-secrets.yaml" = {
|
age.secrets."home-assistant-secrets.yaml" = {
|
||||||
|
@ -97,16 +102,7 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx = {
|
nodes.ward-web-proxy = {
|
||||||
upstreams.homeassistant = {
|
|
||||||
extraConfig = ''
|
|
||||||
zone homeassistant 64k;
|
|
||||||
keepalive 2;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nodes.ward = {
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
upstreams."home-assistant" = {
|
upstreams."home-assistant" = {
|
||||||
servers."${config.wireguard.proxy-home.ipv4}:${toString config.services.home-assistant.config.http.server_port}" = {};
|
servers."${config.wireguard.proxy-home.ipv4}:${toString config.services.home-assistant.config.http.server_port}" = {};
|
||||||
|
@ -117,7 +113,7 @@ in {
|
||||||
};
|
};
|
||||||
virtualHosts.${homeDomain} = {
|
virtualHosts.${homeDomain} = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
useACMEWildcardHost = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://home-assistant";
|
proxyPass = "http://home-assistant";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
|
|
@ -27,12 +27,6 @@ in {
|
||||||
interfaces = ["wlan1"];
|
interfaces = ["wlan1"];
|
||||||
service-sockets-max-retries = -1;
|
service-sockets-max-retries = -1;
|
||||||
};
|
};
|
||||||
option-data = [
|
|
||||||
{
|
|
||||||
name = "domain-name-servers";
|
|
||||||
data = "192.168.1.3"; # FIXME: global (also search for 192.168 and "*Ip =")
|
|
||||||
}
|
|
||||||
];
|
|
||||||
subnet4 = [
|
subnet4 = [
|
||||||
{
|
{
|
||||||
interface = "wlan1";
|
interface = "wlan1";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue