pepe update 20.09

This commit is contained in:
Ingolf Wagner 2020-11-22 01:58:32 +01:00
parent 543b582f60
commit 94d29220d8
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
14 changed files with 86 additions and 24 deletions

View file

@ -57,11 +57,12 @@
# lvm volume group # lvm volume group
# ---------------- # ----------------
boot.initrd.luks.devices = [{ boot.initrd.luks.devices = {
name = "secure_vg"; "secure_vg" = {
device = "/dev/sda2"; device = "/dev/sda2";
preLVM = true; preLVM = true;
}]; };
};
# NTFS support # NTFS support
# ------------ # ------------

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./mqtt.nix ./mqtt.nix
./zigbee2mqtt/buttons.nix ./zigbee2mqtt/buttons.nix
./zigbee2mqtt/configurationHelper.nix
./zigbee2mqtt/doors.nix ./zigbee2mqtt/doors.nix
./zigbee2mqtt/fyrtur.nix ./zigbee2mqtt/fyrtur.nix
./zigbee2mqtt/heater.nix ./zigbee2mqtt/heater.nix
@ -9,16 +10,55 @@
./zigbee2mqtt/lights.nix ./zigbee2mqtt/lights.nix
./zigbee2mqtt/motion.nix ./zigbee2mqtt/motion.nix
./zigbee2mqtt/repeater.nix ./zigbee2mqtt/repeater.nix
./zigbee2mqtt/service.nix
./zigbee2mqtt/temperatur.nix ./zigbee2mqtt/temperatur.nix
]; ];
#services.zigbee2mqtt = {
# enable = true;
# mqttPassword = lib.fileContents <secrets/zigbee/password>;
# networkKey = import <secrets/home-assistant/zigbee/networkKey>;
# # only turn on for new devices, usually turn of for security reasons.
# discover = true;
#};
# new
services.zigbee2mqtt = { services.zigbee2mqtt = {
enable = true; enable = true;
mqttPassword = lib.fileContents <secrets/zigbee/password>; config = {
networkKey = import <secrets/home-assistant/zigbee/networkKey>;
# only turn on for new devices, usually turn of for security reasons. # Home Assistant integration (MQTT discovery)
discover = true; homeassistant = false;
# allow new devices to join
permit_join = true;
# MQTT settings
mqtt = {
# MQTT base topic for zigbee2mqtt MQTT messages
base_topic = "zigbee2mqtt";
# MQTT server URL
server = "mqtt://127.0.0.1:1883";
# MQTT server authentication, uncomment if required:
user = "zigbee";
password = lib.fileContents <secrets/zigbee/password>;
};
# Serial settings
serial = {
port = "/dev/ttyACM0";
# disable LED of CC2531 USB sniffer
disable_led = true;
};
# you own network key,
# 16 numbers between 0 and 255
# see https://www.zigbee2mqtt.io/how_tos/how_to_secure_network.html
advanced.network_key = import <secrets/home-assistant/zigbee/networkKey>;
# todo : devices should be defined later
#devices = cfg.devices;
};
}; };
} }

View file

@ -9,21 +9,21 @@ let
# https://www.zigbee2mqtt.io/devices/WXKG12LM.html # https://www.zigbee2mqtt.io/devices/WXKG12LM.html
allDevices = { allDevices = {
"button_1" = { "button_a1" = {
id = "0x00158d0002b04f65"; id = "0x00158d0002b04f65";
#groups = [ "living_room" ]; #groups = [ "living_room" ];
states.single = "input_boolean.situation_toggle"; states.single = "input_boolean.situation_toggle";
states.hold = "input_boolean.printer_toggle"; states.hold = "input_boolean.printer_toggle";
states.double = "input_boolean.windows_up"; states.double = "input_boolean.windows_up";
}; };
"button_2" = { "button_a2" = {
id = "0x00158d0002b04f09"; id = "0x00158d0002b04f09";
#groups = [ "bed_room" ]; #groups = [ "bed_room" ];
states.single = "input_boolean.situation_toggle"; states.single = "input_boolean.situation_toggle";
states.hold = "input_boolean.printer_toggle"; states.hold = "input_boolean.printer_toggle";
states.double = "input_boolean.windows_up"; states.double = "input_boolean.windows_up";
}; };
"button_3" = { "button_a3" = {
id = "0x00158d0002b00e04"; id = "0x00158d0002b00e04";
#groups = [ "bed_room" ]; #groups = [ "bed_room" ];
states.single = "input_boolean.situation_toggle"; states.single = "input_boolean.situation_toggle";
@ -34,7 +34,7 @@ let
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { value = {

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.zigbee2mqttConfiguration;
in {
options.services.zigbee2mqttConfiguration = mkOption {
type = with types; attrs;
description = ''
device definitions.
'';
};
config = {
services.zigbee2mqtt.config.devices = cfg;
};
}

View file

@ -12,7 +12,7 @@ let
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { value = {

View file

@ -13,7 +13,7 @@ let
# -t "zigbee2mqtt/fyrtur1/set" -m '{"position":15}' # -t "zigbee2mqtt/fyrtur1/set" -m '{"position":15}'
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { value = {

View file

@ -14,7 +14,7 @@ let
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { value = {

View file

@ -13,7 +13,7 @@ let
# -t "zigbee2mqtt/led_1/set" -m '{"state":"OFF"}' # -t "zigbee2mqtt/led_1/set" -m '{"state":"OFF"}'
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { value = {

View file

@ -15,7 +15,7 @@ let
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { value = {

View file

@ -16,7 +16,7 @@ let
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, timeout ? 65, ... }: { { id, timeout ? 65, ... }: {
name = id; name = id;
value = { value = {

View file

@ -10,7 +10,7 @@ let
}; };
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { friendly_name = name; }; value = { friendly_name = name; };

View file

@ -15,7 +15,7 @@ let
in { in {
services.zigbee2mqtt.devices = lib.mapAttrs' (name: services.zigbee2mqttConfiguration = lib.mapAttrs' (name:
{ id, ... }: { { id, ... }: {
name = id; name = id;
value = { value = {

View file

@ -13,7 +13,7 @@ in {
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bitwig-studio #bitwig-studio
sononym-crawler sononym-crawler
# rust development environment # rust development environment

View file

@ -9,7 +9,8 @@ rustPlatform.buildRustPackage rec {
sha256 = "1bnxvgaa58hga20ywgk728aj4wll2rhxgrdp477d2d8isifvij4v"; sha256 = "1bnxvgaa58hga20ywgk728aj4wll2rhxgrdp477d2d8isifvij4v";
}; };
cargoSha256 = "05mm82hdbs36p6mr4qdpip16phg28r44lbni09x48qni81dbw3wx"; cargoSha256 = "1hhgk3mpmd143d3kfhxsaz2y5aksnwiz1bh4396hh0j7j4kqbgrw";
#cargoSha256 = "05mm82hdbs36p6mr4qdpip16phg28r44lbni09x48qni81dbw3wx";
#verifyCargoDeps = true; #verifyCargoDeps = true;
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];