Add fluffy vpn
This commit is contained in:
parent
78c4b35218
commit
6baca7e408
7 changed files with 100 additions and 84 deletions
|
@ -80,6 +80,13 @@ with lib;
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
hera = "${p}::1";
|
hera = "${p}::1";
|
||||||
|
vpn = rec {
|
||||||
|
prefix = "fdc0:7";
|
||||||
|
hera = "${prefix}::1";
|
||||||
|
fluffy = "${prefix}::2";
|
||||||
|
apollo = "${prefix}::5";
|
||||||
|
zeus = "${prefix}::4";
|
||||||
|
};
|
||||||
hera-wg-host = "${p}::100:0:1";
|
hera-wg-host = "${p}::100:0:1";
|
||||||
|
|
||||||
hera-v4 = "213.136.94.190";
|
hera-v4 = "213.136.94.190";
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
hera = "npDW4BUiXcxPXQ/MObP6PlK8/PcMlz/Bwo5FlCCUx3E=";
|
hera = "npDW4BUiXcxPXQ/MObP6PlK8/PcMlz/Bwo5FlCCUx3E=";
|
||||||
apollo = "hYziEwk74g7v7GpIafLvC95dje2BI4saoEtJXXu2txs=";
|
apollo = "hYziEwk74g7v7GpIafLvC95dje2BI4saoEtJXXu2txs=";
|
||||||
zeus = "GmMgJForLglBmXhvLD/sUoZMy2xwavHietmBOLTSvkI=";
|
zeus = "GmMgJForLglBmXhvLD/sUoZMy2xwavHietmBOLTSvkI=";
|
||||||
|
fluffy = "uA9hJWDjAQENPtPPb/osNyfchy++k8TrohxXnrp9nSs=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,24 +98,21 @@ in
|
||||||
ipv6.addresses = [{ address = localAddress; prefixLength = 64; }];
|
ipv6.addresses = [{ address = localAddress; prefixLength = 64; }];
|
||||||
useDHCP = true;
|
useDHCP = true;
|
||||||
};
|
};
|
||||||
#wireguard.interfaces = {
|
wireguard.interfaces = {
|
||||||
# m0wire = {
|
m0wire = {
|
||||||
# allowedIPsAsRoutes = false;
|
ips = [ "${hosts.vpn.fluffy}/64" ];
|
||||||
# ips = [ "${hosts.zeus-wg}/112" ];
|
privateKeyFile = "/disk/persist/wireguard-private-key";
|
||||||
# privateKeyFile = "/disk/persist/wireguard-private-key";
|
peers = [
|
||||||
# peers = [
|
{
|
||||||
# {
|
publicKey = wireguard.pub.hera;
|
||||||
# publicKey = wireguard.pub.hera;
|
allowedIPs = [ "${hosts.vpn.prefix}::/64" ];
|
||||||
# allowedIPs = [ "::/0" ];
|
endpoint = "[${hosts.hera-wg-host}]:${builtins.toString wireguard.port}";
|
||||||
# endpoint = "[${hosts.hera-wg-host}]:${builtins.toString wireguard.port}";
|
presharedKeyFile = pkgs.privatePath "wireguard/psk";
|
||||||
# presharedKeyFile = pkgs.privatePath "wireguard/psk";
|
persistentKeepalive = 25;
|
||||||
# persistentKeepalive = 25;
|
}
|
||||||
# }
|
];
|
||||||
# ];
|
};
|
||||||
# postSetup =
|
};
|
||||||
# [ "${pkgs.iproute}/bin/ip route add ${prefix}::/96 dev m0wire" ];
|
|
||||||
# };
|
|
||||||
#};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
|
|
@ -61,19 +61,26 @@ in
|
||||||
firewall.allowedUDPPorts = [ wireguard.port ];
|
firewall.allowedUDPPorts = [ wireguard.port ];
|
||||||
wireguard.interfaces = {
|
wireguard.interfaces = {
|
||||||
m0wire = {
|
m0wire = {
|
||||||
ips = [ "${hosts.hera-wg}/112" ];
|
ips = [ "${hosts.hera-wg}/112" "${hosts.vpn.hera}/64" ];
|
||||||
privateKeyFile = pkgs.privatePath "wireguard/hera-private";
|
privateKeyFile = pkgs.privatePath "wireguard/hera-private";
|
||||||
listenPort = wireguard.port;
|
listenPort = wireguard.port;
|
||||||
peers = [{
|
peers = [
|
||||||
|
{
|
||||||
publicKey = wireguard.pub.zeus;
|
publicKey = wireguard.pub.zeus;
|
||||||
allowedIPs = [ "${hosts.zeus-wg}/128" ];
|
allowedIPs = [ "${hosts.zeus-wg}/128" "${hosts.vpn.zeus}/128" ];
|
||||||
presharedKeyFile = pkgs.privatePath "wireguard/psk";
|
presharedKeyFile = pkgs.privatePath "wireguard/psk";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
publicKey = wireguard.pub.apollo;
|
publicKey = wireguard.pub.apollo;
|
||||||
allowedIPs = [ "${hosts.apollo-wg}/128" ];
|
allowedIPs = [ "${hosts.apollo-wg}/128" "${hosts.vpn.apollo}/128" ];
|
||||||
presharedKeyFile = pkgs.privatePath "wireguard/psk";
|
presharedKeyFile = pkgs.privatePath "wireguard/psk";
|
||||||
}];
|
}
|
||||||
|
{
|
||||||
|
publicKey = wireguard.pub.fluffy;
|
||||||
|
allowedIPs = [ "${hosts.vpn.fluffy}/128" ];
|
||||||
|
presharedKeyFile = pkgs.privatePath "wireguard/psk";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
hosts = lib.zipAttrs
|
hosts = lib.zipAttrs
|
||||||
(
|
(
|
||||||
lib.mapAttrsToList (host: ip: { "${ip}" = "${host} ${host}.m-0.eu"; })
|
lib.mapAttrsToList (host: ip: if builtins.typeOf ip == "set" then { } else { "${ip}" = "${host} ${host}.m-0.eu"; })
|
||||||
config.m-0.hosts
|
config.m-0.hosts
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -264,6 +264,11 @@ in
|
||||||
mobile_app = { };
|
mobile_app = { };
|
||||||
recorder = { };
|
recorder = { };
|
||||||
ssdp = { };
|
ssdp = { };
|
||||||
|
template = [
|
||||||
|
{ sensor = [{ state = "{% if is_state('switch.luftentfeuchter', 'on') %}1{% else %}0{% endif %}"; name = "Luftentfeuchter"; }]; }
|
||||||
|
{ sensor = [{ state = "{% if is_state('binary_sensor.schlafzimmerfenster', 'on') %}1{% else %}0{% endif %}"; name = "Schlafzimmerfenster"; }]; }
|
||||||
|
{ sensor = [{ state = "{% if is_state('climate.schlafzimmer', 'heat') %}1{% else %}0{% endif %}"; name = "Schlafzimmerheizung"; }]; }
|
||||||
|
];
|
||||||
input_number = {
|
input_number = {
|
||||||
target_temperature_schlafzimmer = {
|
target_temperature_schlafzimmer = {
|
||||||
name = "Zieltemperatur Schlafzimmer";
|
name = "Zieltemperatur Schlafzimmer";
|
||||||
|
@ -465,69 +470,68 @@ in
|
||||||
inherit badges;
|
inherit badges;
|
||||||
cards = [
|
cards = [
|
||||||
{
|
{
|
||||||
type = "entities";
|
type = "vertical-stack";
|
||||||
title = "Schlafzimmer";
|
cards = [
|
||||||
icon = "mdi:bed-king";
|
{
|
||||||
show_header_toggle = false;
|
type = "custom:mini-graph-card";
|
||||||
entities = [
|
entities = [
|
||||||
{
|
{ entity = "sensor.schlafzimmer_humidity"; name = "Luftfeuchtigkeit"; show_fill = false; state_adaptive_color = true; }
|
||||||
type = "custom:multiple-entity-row";
|
{ entity = "sensor.luftentfeuchter"; name = "Entfeuchter"; color = "#0000ff"; y_axis = "secondary"; show_fill = true; show_points = false; show_line = false; smoothing = false; }
|
||||||
entity = "sensor.schlafzimmer_temperature";
|
{ entity = "sensor.schlafzimmerfenster"; name = "Fenster"; color = "#ff0000"; y_axis = "secondary"; show_fill = true; show_points = false; show_line = false; smoothing = false; }
|
||||||
name = "Temperatur";
|
|
||||||
unit = false;
|
|
||||||
entities = [{ entity = "climate.schlafzimmer"; name = "Heizung"; }
|
|
||||||
{ entity = "climate.schlafzimmer"; attribute = "temperature"; name = "Zieltemp. an Heizung"; }
|
|
||||||
{ entity = "climate.schlafzimmer"; attribute = "current_temperature"; name = "Temp. an Heizung"; unit = false; }
|
|
||||||
{ entity = "input_number.target_temperature_schlafzimmer"; name = "Zieltemp."; unit = false; }];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "custom:multiple-entity-row";
|
|
||||||
entity = "switch.luftentfeuchter";
|
|
||||||
toggle = true;
|
|
||||||
state_color = true;
|
|
||||||
entities = [{ entity = "sensor.schlafzimmer_humidity"; name = "Luftfeuchtigkeit"; }];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "custom:multiple-entity-row";
|
|
||||||
entity = "group.schlafzimmer_lights";
|
|
||||||
toggle = true;
|
|
||||||
state_color = true;
|
|
||||||
name = "Lichter";
|
|
||||||
entities = [
|
|
||||||
# { entity = "switch.lichterkette_schlafzimmer"; state_color = true; toggle = true; name = "Lichterkette"; }
|
|
||||||
{ entity = "switch.weihnachtsstern_schlafzimmer"; state_color = true; toggle = true; name = "Stern"; }
|
|
||||||
];
|
];
|
||||||
}
|
color_thresholds = [{ value = 0; color = "#009933"; } { value = 64; color = "#ffbf00"; } { value = 66; color = "#ff0000"; }];
|
||||||
{ entity = "binary_sensor.schlafzimmerfenster"; secondary_info = "last-changed"; name = "Fenster"; }
|
color_thresholds_transition = "hard";
|
||||||
|
show = {
|
||||||
|
labels = true;
|
||||||
|
labels_secondary = "hover";
|
||||||
|
};
|
||||||
|
lower_bound_secondary = 0;
|
||||||
|
upper_bound_secondary = 1;
|
||||||
|
hour24 = true;
|
||||||
|
decimals = 1;
|
||||||
|
points_per_hour = 6;
|
||||||
|
hours_to_show = 6;
|
||||||
|
update_interval = 30;
|
||||||
|
line_width = 3;
|
||||||
|
state_map = [
|
||||||
|
{ value = 0; label = "Zu/Aus"; }
|
||||||
|
{ value = 1; label = "An/Auf"; }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
type = "custom:mini-graph-card";
|
type = "custom:mini-graph-card";
|
||||||
entities = [
|
entities = [
|
||||||
{ entity = "sensor.schlafzimmer_humidity"; state_adaptive_color = true; }
|
{ entity = "sensor.schlafzimmer_temperature"; name = "Temperatur"; show_fill = false; }
|
||||||
|
{ entity = "input_number.target_temperature_schlafzimmer"; name = "Zieltemperatur"; show_fill = false; }
|
||||||
|
{ entity = "sensor.schlafzimmerheizung"; name = "Heizung"; y_axis = "secondary"; show_fill = true; show_points = false; show_line = false; smoothing = false; }
|
||||||
];
|
];
|
||||||
color_thresholds = [{ value = 0; color = "#009933"; } { value = 64; color = "#ffbf00"; } { value = 66; color = "#ff0000"; }];
|
|
||||||
color_thresholds_transition = "hard";
|
|
||||||
show = {
|
show = {
|
||||||
fill = "fade";
|
|
||||||
labels = true;
|
labels = true;
|
||||||
|
labels_secondary = "hover";
|
||||||
};
|
};
|
||||||
upper_bound = "~70";
|
lower_bound_secondary = 0;
|
||||||
hour24 = true;
|
upper_bound_secondary = 1;
|
||||||
lower_bound = "~50";
|
hours_to_show = 6;
|
||||||
decimals = 1;
|
|
||||||
update_interval = 30;
|
update_interval = 30;
|
||||||
points_per_hour = 12;
|
line_width = 3;
|
||||||
|
hour24 = true;
|
||||||
|
decimals = 1;
|
||||||
|
points_per_hour = 6;
|
||||||
|
state_map = [
|
||||||
|
{ value = 0; label = "Aus"; }
|
||||||
|
{ value = 1; label = "An"; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
type = "history-graph";
|
type = "grid";
|
||||||
entities = [
|
cards = [
|
||||||
"sensor.schlafzimmer_temperature"
|
{ type = "custom:slider-button-card"; entity = "switch.weihnachtsstern_schlafzimmer"; }
|
||||||
"input_number.target_temperature_schlafzimmer"
|
{ type = "custom:slider-button-card"; entity = "switch.luftentfeuchter"; }
|
||||||
"sensor.schlafzimmer_humidity"
|
{ type = "custom:slider-button-card"; entity = "climate.schlafzimmer"; }
|
||||||
"climate.schlafzimmer"
|
|
||||||
"switch.luftentfeuchter"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ in
|
||||||
"L+ /run/hass/mini-media-player.js - - - - ${nur.hassLovelaceModules.mini-media-player}/mini-media-player-bundle.js"
|
"L+ /run/hass/mini-media-player.js - - - - ${nur.hassLovelaceModules.mini-media-player}/mini-media-player-bundle.js"
|
||||||
"L+ /run/hass/multiple-entity-row.js - - - - ${nur.hassLovelaceModules.multiple-entity-row}/multiple-entity-row.js"
|
"L+ /run/hass/multiple-entity-row.js - - - - ${nur.hassLovelaceModules.multiple-entity-row}/multiple-entity-row.js"
|
||||||
"L+ /run/hass/sun-card.js - - - - ${nur.hassLovelaceModules.sun-card}/sun-card.js"
|
"L+ /run/hass/sun-card.js - - - - ${nur.hassLovelaceModules.sun-card}/sun-card.js"
|
||||||
"L+ /run/hass/swipe-navigation.js - - - - ${nur.hassLovelaceModules.swipe-navigation}/swipe-navigation.js"
|
"L+ /run/hass/slider-button-card.js - - - - ${nur.hassLovelaceModules.slider-button-card}/slider-button-card.js"
|
||||||
"L+ /run/hass/rmv-card.js - - - - ${nur.hassLovelaceModules.rmv-card}/rmv-card.js"
|
"L+ /run/hass/rmv-card.js - - - - ${nur.hassLovelaceModules.rmv-card}/rmv-card.js"
|
||||||
"L+ /run/hass/weather-card-chart.js - - - - ${nur.hassLovelaceModules.weather-card-chart}/weather-card-chart.js"
|
"L+ /run/hass/weather-card-chart.js - - - - ${nur.hassLovelaceModules.weather-card-chart}/weather-card-chart.js"
|
||||||
];
|
];
|
||||||
|
@ -28,7 +28,7 @@ in
|
||||||
(mkLovelaceModule "rmv-card")
|
(mkLovelaceModule "rmv-card")
|
||||||
(mkLovelaceModule "weather-card-chart")
|
(mkLovelaceModule "weather-card-chart")
|
||||||
(mkLovelaceModule "sun-card")
|
(mkLovelaceModule "sun-card")
|
||||||
(mkLovelaceModule "swipe-navigation")
|
(mkLovelaceModule "slider-button-card")
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue