1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

feat: integrate fritzbox smart home devices

This commit is contained in:
oddlama 2024-05-23 22:38:21 +02:00
parent db86d754c4
commit 93061af475
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 42 additions and 10 deletions

View file

@ -94,6 +94,7 @@ in {
nodes.sentinel.config.networking.providedDomains.loki
nodes.sentinel.config.networking.providedDomains.paperless
"home.${config.repo.secrets.global.domains.me}"
"fritzbox.${config.repo.secrets.global.domains.me}"
];
filters = [
{

View file

@ -1,5 +1,6 @@
{config, ...}: let
inherit (config.repo.secrets.local) acme;
fritzboxDomain = "fritzbox.${config.repo.secrets.global.domains.me}";
in {
wireguard.proxy-home = {
client.via = "ward";
@ -32,6 +33,33 @@ in {
inherit (acme) certs wildcardDomains;
};
services.nginx = {
upstreams.fritzbox = {
servers."192.168.178.1" = {};
extraConfig = ''
zone grafana 64k;
keepalive 2;
'';
};
virtualHosts.${fritzboxDomain} = {
forceSSL = true;
useACMEWildcardHost = true;
locations."/" = {
proxyPass = "http://fritzbox";
proxyWebsockets = true;
};
# Allow using self-signed certs. We just want to make sure the connection
# is over TLS.
# FIXME: refer to lan 192.168... and fd10:: via globals
extraConfig = ''
proxy_ssl_verify off;
allow 192.168.1.0/24;
allow fd10::/64;
deny all;
'';
};
};
users.groups.acme.members = ["nginx"];
services.nginx.enable = true;
services.nginx.recommendedSetup = true;