aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/home-assistant.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-01-08 11:25:01 +0100
committerKarel Kočí <cynerd@email.cz>2023-01-08 11:25:01 +0100
commitd5dc7479c489d17e6dcacf081c0f1b5242d99bd9 (patch)
treec12d18231cacb81ff5b69a2073894d228e3c81e7 /nixos/modules/home-assistant.nix
parentc7a226a92d65cedd384fa29083efdbb07a6084b0 (diff)
downloadnixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.tar.gz
nixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.tar.bz2
nixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.zip
Format using Alejandra
Diffstat (limited to 'nixos/modules/home-assistant.nix')
-rw-r--r--nixos/modules/home-assistant.nix70
1 files changed, 37 insertions, 33 deletions
diff --git a/nixos/modules/home-assistant.nix b/nixos/modules/home-assistant.nix
index e4f2232..0f2df9e 100644
--- a/nixos/modules/home-assistant.nix
+++ b/nixos/modules/home-assistant.nix
@@ -1,18 +1,17 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-let
-
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib; let
cnf = config.cynerd.home-assistant;
-
in {
options = {
cynerd.home-assistant = mkEnableOption "Enable Home Assistant and Bigclown";
};
config = mkIf cnf {
-
services.mosquitto = {
enable = true;
listeners = [
@@ -134,27 +133,31 @@ in {
};
services.telegraf.extraConfig = {
- outputs.influxdb_v2 = [{
- urls = ["http://errol:8086"];
- token = "$INFLUX_TOKEN";
- organization = "personal";
- bucket = "bigclown";
- tagpass.source = ["bigclown"];
- }];
+ outputs.influxdb_v2 = [
+ {
+ urls = ["http://errol:8086"];
+ token = "$INFLUX_TOKEN";
+ organization = "personal";
+ bucket = "bigclown";
+ tagpass.source = ["bigclown"];
+ }
+ ];
inputs.mqtt_consumer = let
consumer = data_type: topics: {
- tags = { source = "bigclown"; };
+ tags = {source = "bigclown";};
servers = ["tcp://localhost:1883"];
topics = topics;
username = "telegraf";
password = "$MQTT_PASSWORD";
data_format = "value";
data_type = data_type;
- topic_parsing = [{
- topic = "bigclown/node/+/+/+/+";
- measurement = "_/_/_/_/_/measurement";
- tags = "_/_/device/field/_/_";
- }];
+ topic_parsing = [
+ {
+ topic = "bigclown/node/+/+/+/+";
+ measurement = "_/_/_/_/_/measurement";
+ tags = "_/_/device/field/_/_";
+ }
+ ];
};
in [
(consumer "float" [
@@ -170,11 +173,13 @@ in {
"bigclown/node/+/flood-detector/+/alarm"
])
];
- processors.pivot = [{
- tag_key = "field";
- value_key = "value";
- tagpass.source = ["bigclown"];
- }];
+ processors.pivot = [
+ {
+ tag_key = "field";
+ value_key = "value";
+ tagpass.source = ["bigclown"];
+ }
+ ];
};
services.home-assistant = {
@@ -204,10 +209,11 @@ in {
};
extraComponents = [];
package = pkgs.home-assistant.override {
- extraPackages = pkgs: with pkgs; [
- securetar
- ];
- packageOverrides = (self: super: {
+ extraPackages = pkgs:
+ with pkgs; [
+ securetar
+ ];
+ packageOverrides = self: super: {
scapy = super.scapy.override {
withPlottingSupport = false;
};
@@ -215,10 +221,8 @@ in {
dontUsePytestCheck = true;
dontUseSetuptoolsCheck = true;
});
- });
+ };
};
};
-
};
-
}