many changes and more modularizing

This commit is contained in:
2024-12-12 22:30:24 +01:00
parent df50e70f3e
commit c96c24f864
109 changed files with 20900 additions and 278 deletions

View File

@@ -6,6 +6,7 @@ let
url = "https://github.com/nixos/nixpkgs/";
rev = "41dea55321e5a999b17033296ac05fe8a8b5a257";
}) {};
networkPrefix = config.networkPrefix;
in
{
users.users.hass = {
@@ -35,8 +36,8 @@ in
ephemeral = false;
privateNetwork = true;
hostBridge = "server";
hostAddress = "10.42.97.1";
localAddress = "10.42.97.20/24";
hostAddress = "${networkPrefix}.97.1";
localAddress = "${networkPrefix}.97.20/24";
extraFlags = [
"--capability=CAP_NET_ADMIN"
"--capability=CAP_MKNOD"
@@ -74,7 +75,9 @@ in
};
};
config = { lib, config, pkgs, ... }: {
networkPrefix = networkPrefix;
imports = [
../network-prefix.nix
./3dprinter.nix
./ac.nix
# ./aeg.nix
@@ -103,11 +106,11 @@ in
hostName = "home-assistant";
useHostResolvConf = false;
defaultGateway = {
address = "10.42.96.1";
address = "${networkPrefix}.96.1";
interface = "eth0";
};
firewall.enable = false;
nameservers = [ "10.42.97.1" ];
nameservers = [ "${networkPrefix}.97.1" ];
};
environment.systemPackages = [

View File

@@ -71,6 +71,21 @@
action = [
{
choose = [
{
conditions = [ "{{ is_state('automation.light_sunset', 'off') }}" ];
sequence = [
{
service = "light.turn_on";
target = {
entity_id = "{{ trigger.entity_id }}";
};
data = {
brightness_pct = 100;
color_temp = 250;
};
}
];
}
{
conditions = [ "{{ state_attr('sun.sun', 'elevation') < 5 and trigger.entity_id == 'light.toilet_lights' }}" ];
sequence = [

View File

@@ -1,4 +1,4 @@
{
{ config, lib, ... }: {
services.home-assistant.extraComponents = [
"wake_on_lan"
];
@@ -41,7 +41,7 @@
service = "wake_on_lan.send_magic_packet";
data = {
mac = "04:7c:16:d5:63:5e";
broadcast_address = "10.42.96.5";
broadcast_address = "${config.networkPrefix}.96.5";
broadcast_port = 9;
};
}