mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
refactor: adjust wireguard accessors to use globals
This commit is contained in:
parent
157c303f38
commit
b885d1062b
28 changed files with 169 additions and 133 deletions
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
globals,
|
||||
inputs,
|
||||
nodes,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
|
@ -63,7 +62,7 @@
|
|||
};
|
||||
|
||||
# Connect safely via wireguard to skip authentication
|
||||
networking.hosts.${nodes.ward-web-proxy.config.wireguard.proxy-home.ipv4} = [
|
||||
networking.hosts.${globals.wireguard.proxy-home.hosts.ward-web-proxy.ipv4} = [
|
||||
globals.services.influxdb.domain
|
||||
];
|
||||
meta.telegraf = {
|
||||
|
|
|
@ -35,7 +35,10 @@ in
|
|||
nodes.ward-web-proxy = {
|
||||
services.nginx = {
|
||||
upstreams."esphome" = {
|
||||
servers."${config.wireguard.proxy-home.ipv4}:${toString config.services.esphome.port}" = { };
|
||||
servers."${
|
||||
globals.wireguard.proxy-home.hosts.${config.node.name}.ipv4
|
||||
}:${toString config.services.esphome.port}" =
|
||||
{ };
|
||||
extraConfig = ''
|
||||
zone esphome 64k;
|
||||
keepalive 2;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
config,
|
||||
globals,
|
||||
lib,
|
||||
nodes,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
@ -89,7 +88,7 @@ in
|
|||
server_host = [ "0.0.0.0" ];
|
||||
server_port = 8123;
|
||||
use_x_forwarded_for = true;
|
||||
trusted_proxies = [ nodes.ward-web-proxy.config.wireguard.proxy-home.ipv4 ];
|
||||
trusted_proxies = [ globals.wireguard.proxy-home.hosts.nodes.ward-web-proxy.ipv4 ];
|
||||
};
|
||||
|
||||
zha.zigpy_config.source_routing = true;
|
||||
|
@ -210,14 +209,16 @@ in
|
|||
fritzboxDomain
|
||||
];
|
||||
|
||||
networking.hosts.${nodes.ward-adguardhome.config.wireguard.proxy-home.ipv4} = [
|
||||
networking.hosts.${globals.wireguard.proxy-home.hosts.ward-adguardhome.ipv4} = [
|
||||
"adguardhome.internal"
|
||||
];
|
||||
|
||||
nodes.ward-web-proxy = {
|
||||
services.nginx = {
|
||||
upstreams."home-assistant" = {
|
||||
servers."${config.wireguard.proxy-home.ipv4}:${toString config.services.home-assistant.config.http.server_port}" =
|
||||
servers."${
|
||||
globals.wireguard.proxy-home.hosts.${config.node.name}.ipv4
|
||||
}:${toString config.services.home-assistant.config.http.server_port}" =
|
||||
{ };
|
||||
extraConfig = ''
|
||||
zone home-assistant 64k;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue