1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/traadfri.nix

44 lines
953 B
Nix
Raw Permalink Normal View History

2022-03-10 21:52:12 +01:00
{
2023-02-23 16:53:53 +01:00
config,
2022-03-10 21:52:12 +01:00
pkgs,
lib,
...
}: let
2023-02-23 16:53:53 +01:00
inherit (import ../lib) localAddresses;
2021-05-17 07:08:02 +02:00
living-room-id = 131090;
2022-03-10 21:52:12 +01:00
in {
environment.systemPackages = [
(pkgs.writers.writeDashBin "traadfri-party" ''
while true; do
for color in $(traadfri colours | shuf); do
echo "$color"
traadfri group "''${2:-${toString living-room-id}}" --on --colour="$color"
sleep "''${1:-2}"
done
done
'')
];
age.secrets.traadfri-key = {
file = ../secrets/traadfri-key.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
2023-02-23 16:53:53 +01:00
2019-06-10 17:05:36 +02:00
niveum.traadfri = {
enable = true;
user = "kmein";
2020-10-24 13:27:36 +02:00
host = localAddresses.tradfri;
2023-02-23 16:53:53 +01:00
keyFile = config.age.secrets.traadfri-key.path;
2019-06-10 17:05:36 +02:00
rooms = {
2020-01-22 16:39:49 +01:00
corridor = 131080;
kitchen = 131081;
2020-07-11 20:42:04 +02:00
bedroom = 131082;
living-room = living-room-id;
2020-07-11 20:42:04 +02:00
bedside = 131087;
2022-01-30 22:47:54 +01:00
chain = 131089;
2019-06-10 17:05:36 +02:00
};
};
}