terrier: install Home Assistant
This commit is contained in:
parent
9e57effbbb
commit
0479d039b1
4 changed files with 90 additions and 28 deletions
|
@ -54,6 +54,19 @@
|
||||||
"ha.campares.duckdns.org" = proxyWebsockets config.services.home-assistant.config.http.server_port;
|
"ha.campares.duckdns.org" = proxyWebsockets config.services.home-assistant.config.http.server_port;
|
||||||
|
|
||||||
"wg.campares.duckdns.org" = proxySimple config.services.wg-access-server.settings.port;
|
"wg.campares.duckdns.org" = proxySimple config.services.wg-access-server.settings.port;
|
||||||
|
|
||||||
|
"ha.morada.campares.duckdns.org" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://[544:5d19:c117:8cc2:85c6:6a16:e78a:9737]:8123";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_buffering off;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
imports = [
|
||||||
|
./modules/home-assistant.nix
|
||||||
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform = "aarch64-linux";
|
||||||
|
|
||||||
boot.initrd.systemd.tpm2.enable = false; # https://github.com/NixOS/nixpkgs/issues/344963
|
boot.initrd.systemd.tpm2.enable = false; # https://github.com/NixOS/nixpkgs/issues/344963
|
||||||
|
|
|
@ -216,7 +216,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index": 18,
|
"index": 18,
|
||||||
"attached_to": 10,
|
"attached_to": 11,
|
||||||
"class_list": [
|
"class_list": [
|
||||||
"disk",
|
"disk",
|
||||||
"block_device"
|
"block_device"
|
||||||
|
@ -231,11 +231,11 @@
|
||||||
"name": "Disk",
|
"name": "Disk",
|
||||||
"value": 0
|
"value": 0
|
||||||
},
|
},
|
||||||
"serial": "0xdab60614",
|
"serial": "0x25f1570b",
|
||||||
"model": "Disk",
|
"model": "Disk",
|
||||||
"sysfs_id": "/class/block/mmcblk0",
|
"sysfs_id": "/class/block/mmcblk0",
|
||||||
"sysfs_bus_id": "mmc0:5048",
|
"sysfs_bus_id": "mmc0:59b4",
|
||||||
"sysfs_device_link": "/devices/platform/emmc2bus/fe340000.mmc/mmc_host/mmc0/mmc0:5048",
|
"sysfs_device_link": "/devices/platform/emmc2bus/fe340000.mmc/mmc_host/mmc0/mmc0:59b4",
|
||||||
"unix_device_name": "/dev/mmcblk0",
|
"unix_device_name": "/dev/mmcblk0",
|
||||||
"unix_device_number": {
|
"unix_device_number": {
|
||||||
"type": 98,
|
"type": 98,
|
||||||
|
@ -244,14 +244,14 @@
|
||||||
"range": 32
|
"range": 32
|
||||||
},
|
},
|
||||||
"unix_device_names": [
|
"unix_device_names": [
|
||||||
"/dev/disk/by-id/mmc-SD16G_0xdab60614",
|
"/dev/disk/by-id/mmc-EC1S5_0x25f1570b",
|
||||||
"/dev/disk/by-path/platform-fe340000.mmc",
|
"/dev/disk/by-path/platform-fe340000.mmc",
|
||||||
"/dev/mmcblk0"
|
"/dev/mmcblk0"
|
||||||
],
|
],
|
||||||
"resources": [
|
"resources": [
|
||||||
{
|
{
|
||||||
"type": "disk_geo",
|
"type": "disk_geo",
|
||||||
"cylinders": 472576,
|
"cylinders": 1955840,
|
||||||
"heads": 4,
|
"heads": 4,
|
||||||
"sectors": 16,
|
"sectors": 16,
|
||||||
"size": "0x0",
|
"size": "0x0",
|
||||||
|
@ -260,7 +260,7 @@
|
||||||
{
|
{
|
||||||
"type": "size",
|
"type": "size",
|
||||||
"unit": "sectors",
|
"unit": "sectors",
|
||||||
"value_1": 30244864,
|
"value_1": 125173760,
|
||||||
"value_2": 512
|
"value_2": 512
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -1052,7 +1052,7 @@
|
||||||
},
|
},
|
||||||
"slot": {
|
"slot": {
|
||||||
"bus": 0,
|
"bus": 0,
|
||||||
"number": 0
|
"number": 1
|
||||||
},
|
},
|
||||||
"base_class": {
|
"base_class": {
|
||||||
"hex": "0117",
|
"hex": "0117",
|
||||||
|
@ -1060,14 +1060,10 @@
|
||||||
"value": 279
|
"value": 279
|
||||||
},
|
},
|
||||||
"vendor": "",
|
"vendor": "",
|
||||||
"device": "SD Controller 0",
|
"device": "SDIO Controller 1",
|
||||||
"model": "SD Controller 0",
|
"model": "SDIO Controller 1",
|
||||||
"sysfs_id": "/devices/platform/emmc2bus/fe340000.mmc/mmc_host/mmc0/mmc0:5048",
|
"sysfs_id": "/devices/platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001",
|
||||||
"sysfs_bus_id": "mmc0:5048",
|
"sysfs_bus_id": "mmc1:0001"
|
||||||
"driver": "mmcblk",
|
|
||||||
"drivers": [
|
|
||||||
"mmcblk"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index": 11,
|
"index": 11,
|
||||||
|
@ -1082,7 +1078,7 @@
|
||||||
},
|
},
|
||||||
"slot": {
|
"slot": {
|
||||||
"bus": 0,
|
"bus": 0,
|
||||||
"number": 1
|
"number": 0
|
||||||
},
|
},
|
||||||
"base_class": {
|
"base_class": {
|
||||||
"hex": "0117",
|
"hex": "0117",
|
||||||
|
@ -1090,10 +1086,14 @@
|
||||||
"value": 279
|
"value": 279
|
||||||
},
|
},
|
||||||
"vendor": "",
|
"vendor": "",
|
||||||
"device": "SDIO Controller 1",
|
"device": "SD Controller 0",
|
||||||
"model": "SDIO Controller 1",
|
"model": "SD Controller 0",
|
||||||
"sysfs_id": "/devices/platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001",
|
"sysfs_id": "/devices/platform/emmc2bus/fe340000.mmc/mmc_host/mmc0/mmc0:59b4",
|
||||||
"sysfs_bus_id": "mmc1:0001"
|
"sysfs_bus_id": "mmc0:59b4",
|
||||||
|
"driver": "mmcblk",
|
||||||
|
"drivers": [
|
||||||
|
"mmcblk"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"network_controller": [
|
"network_controller": [
|
||||||
|
@ -1233,7 +1233,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index": 13,
|
"index": 13,
|
||||||
"attached_to": 11,
|
"attached_to": 10,
|
||||||
"class_list": [
|
"class_list": [
|
||||||
"network_controller"
|
"network_controller"
|
||||||
],
|
],
|
||||||
|
@ -1284,7 +1284,7 @@
|
||||||
],
|
],
|
||||||
"network_interface": [
|
"network_interface": [
|
||||||
{
|
{
|
||||||
"index": 36,
|
"index": 35,
|
||||||
"attached_to": 0,
|
"attached_to": 0,
|
||||||
"class_list": [
|
"class_list": [
|
||||||
"network_interface"
|
"network_interface"
|
||||||
|
@ -1307,7 +1307,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index": 37,
|
"index": 36,
|
||||||
"attached_to": 0,
|
"attached_to": 0,
|
||||||
"class_list": [
|
"class_list": [
|
||||||
"network_interface"
|
"network_interface"
|
||||||
|
@ -1393,7 +1393,7 @@
|
||||||
"unknown": [
|
"unknown": [
|
||||||
{
|
{
|
||||||
"index": 12,
|
"index": 12,
|
||||||
"attached_to": 11,
|
"attached_to": 10,
|
||||||
"class_list": [
|
"class_list": [
|
||||||
"unknown"
|
"unknown"
|
||||||
],
|
],
|
||||||
|
@ -1433,7 +1433,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index": 14,
|
"index": 14,
|
||||||
"attached_to": 11,
|
"attached_to": 10,
|
||||||
"class_list": [
|
"class_list": [
|
||||||
"unknown"
|
"unknown"
|
||||||
],
|
],
|
||||||
|
@ -1539,7 +1539,7 @@
|
||||||
"resources": [
|
"resources": [
|
||||||
{
|
{
|
||||||
"type": "irq",
|
"type": "irq",
|
||||||
"base": 37,
|
"base": 38,
|
||||||
"triggered": 0,
|
"triggered": 0,
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
|
@ -1557,7 +1557,7 @@
|
||||||
"command": 1030,
|
"command": 1030,
|
||||||
"header_type": 0,
|
"header_type": 0,
|
||||||
"secondary_bus": 0,
|
"secondary_bus": 0,
|
||||||
"irq": 37,
|
"irq": 38,
|
||||||
"prog_if": 48
|
"prog_if": 48
|
||||||
},
|
},
|
||||||
"driver": "xhci_hcd",
|
"driver": "xhci_hcd",
|
||||||
|
|
45
machines/terrier/modules/home-assistant.nix
Normal file
45
machines/terrier/modules/home-assistant.nix
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
{config, ...}: {
|
||||||
|
services.home-assistant = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
extraComponents = [
|
||||||
|
# Components required to complete the onboarding
|
||||||
|
"analytics"
|
||||||
|
"google_translate"
|
||||||
|
"met"
|
||||||
|
"radio_browser"
|
||||||
|
"shopping_list"
|
||||||
|
# Recommended for fast zlib compression
|
||||||
|
# https://www.home-assistant.io/integrations/isal
|
||||||
|
"isal"
|
||||||
|
|
||||||
|
# Additional components
|
||||||
|
"mobile_app"
|
||||||
|
"nmap_tracker"
|
||||||
|
"cast"
|
||||||
|
];
|
||||||
|
config = {
|
||||||
|
homeassistant = {
|
||||||
|
name = "La Morada";
|
||||||
|
external_url = "https://ha.morada.campares.duckdns.org";
|
||||||
|
};
|
||||||
|
|
||||||
|
http = {
|
||||||
|
trusted_proxies = ["4a6:fed0:59ba:507d:baab:15f3:846d:ead4"];
|
||||||
|
use_x_forwarded_for = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
default_config = {};
|
||||||
|
|
||||||
|
"automation ui" = "!include automations.yaml";
|
||||||
|
"scene ui" = "!include scenes.yaml";
|
||||||
|
"script ui" = "!include scripts.yaml";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"f ${config.services.home-assistant.configDir}/automations.yaml 0755 hass hass"
|
||||||
|
"f ${config.services.home-assistant.configDir}/scenes.yaml 0755 hass hass"
|
||||||
|
"f ${config.services.home-assistant.configDir}/scripts.yaml 0755 hass hass"
|
||||||
|
];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue