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

feat: remove traadfri

This commit is contained in:
2023-08-31 10:09:49 +02:00
parent f4e2885b86
commit e76489b6d8
8 changed files with 1 additions and 123 deletions

View File

@@ -12,7 +12,6 @@
in { in {
imports = [ imports = [
inputs.self.nixosModules.system-dependent inputs.self.nixosModules.system-dependent
inputs.self.nixosModules.traadfri
inputs.self.nixosModules.power-action inputs.self.nixosModules.power-action
{ {
boot.supportedFilesystems = ["ntfs"]; boot.supportedFilesystems = ["ntfs"];
@@ -286,7 +285,6 @@ in {
./sound.nix ./sound.nix
./sudo.nix ./sudo.nix
./tmux.nix ./tmux.nix
./traadfri.nix
./unclutter.nix ./unclutter.nix
./vscode.nix ./vscode.nix
./watson.nix ./watson.nix

View File

@@ -1,43 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (import ../lib) localAddresses;
living-room-id = 131090;
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";
};
niveum.traadfri = {
enable = true;
user = "kmein";
host = localAddresses.tradfri;
keyFile = config.age.secrets.traadfri-key.path;
rooms = {
corridor = 131080;
kitchen = 131081;
bedroom = 131082;
living-room = living-room-id;
bedside = 131087;
chain = 131089;
};
};
}

24
flake.lock generated
View File

@@ -541,7 +541,6 @@
"stylix": "stylix", "stylix": "stylix",
"telebots": "telebots", "telebots": "telebots",
"tinc-graph": "tinc-graph", "tinc-graph": "tinc-graph",
"traadfri": "traadfri",
"voidrice": "voidrice", "voidrice": "voidrice",
"wallpaper-generator": "wallpaper-generator", "wallpaper-generator": "wallpaper-generator",
"wallpapers": "wallpapers" "wallpapers": "wallpapers"
@@ -682,29 +681,6 @@
"type": "github" "type": "github"
} }
}, },
"traadfri": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs-old"
]
},
"locked": {
"lastModified": 1677165914,
"narHash": "sha256-3N08NabgDwTUy1n5wxpT27iddFrgXW35E1x2UgAKkDQ=",
"owner": "kmein",
"repo": "traadfri",
"rev": "11571116ed5d2c6478c615d663d1f96f57a97ba9",
"type": "github"
},
"original": {
"owner": "kmein",
"repo": "traadfri",
"type": "github"
}
},
"voidrice": { "voidrice": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@@ -21,7 +21,6 @@
stylix.url = "github:danth/stylix/release-23.05"; stylix.url = "github:danth/stylix/release-23.05";
telebots.url = "github:kmein/telebots"; telebots.url = "github:kmein/telebots";
tinc-graph.url = "github:kmein/tinc-graph"; tinc-graph.url = "github:kmein/tinc-graph";
traadfri.url = "github:kmein/traadfri";
voidrice.url = "github:Lukesmithxyz/voidrice"; voidrice.url = "github:Lukesmithxyz/voidrice";
wallpaper-generator.url = "github:pinpox/wallpaper-generator/v1.1"; wallpaper-generator.url = "github:pinpox/wallpaper-generator/v1.1";
wallpapers.url = "github:kmein/wallpapers"; wallpapers.url = "github:kmein/wallpapers";
@@ -51,8 +50,6 @@
tinc-graph.inputs.flake-utils.follows = "flake-utils"; tinc-graph.inputs.flake-utils.follows = "flake-utils";
tinc-graph.inputs.nixpkgs.follows = "nixpkgs"; tinc-graph.inputs.nixpkgs.follows = "nixpkgs";
tinc-graph.inputs.rust-overlay.follows = "rust-overlay"; tinc-graph.inputs.rust-overlay.follows = "rust-overlay";
traadfri.inputs.flake-utils.follows = "flake-utils";
traadfri.inputs.nixpkgs.follows = "nixpkgs-old";
voidrice.flake = false; voidrice.flake = false;
wallpaper-generator.inputs.flake-utils.follows = "flake-utils"; wallpaper-generator.inputs.flake-utils.follows = "flake-utils";
wallpapers.flake = false; wallpapers.flake = false;
@@ -109,7 +106,6 @@
power-action = import modules/power-action.nix; power-action = import modules/power-action.nix;
system-dependent = import modules/system-dependent.nix; system-dependent = import modules/system-dependent.nix;
telegram-bot = import modules/telegram-bot.nix; telegram-bot = import modules/telegram-bot.nix;
traadfri = import modules/traadfri.nix;
}; };
lib = { lib = {

View File

@@ -5,7 +5,6 @@
android = "192.168.178.35"; android = "192.168.178.35";
manakish = "192.168.178.29"; manakish = "192.168.178.29";
tradfri = "192.168.178.28";
officejet = "192.168.178.27"; officejet = "192.168.178.27";
fritzbox = "192.168.178.1"; fritzbox = "192.168.178.1";
} }

View File

@@ -1,47 +0,0 @@
{
pkgs,
lib,
config,
inputs,
...
}:
with lib; let
cfg = config.niveum.traadfri;
in {
options.niveum.traadfri = {
enable = mkEnableOption "Trådfri CLI";
user = mkOption {type = types.str;};
host = mkOption {type = types.str;};
keyFile = mkOption {type = types.path;};
rooms = mkOption {
type = types.attrsOf types.int;
default = {};
};
bulbs = mkOption {
type = types.attrsOf types.int;
default = {};
};
};
config = mkIf cfg.enable {
environment.systemPackages =
[
(pkgs.writers.writeDashBin "traadfri" ''
export TRAADFRI_USER="${cfg.user}"
export TRAADFRI_KEY="$(cat ${lib.escapeShellArg cfg.keyFile})"
export TRAADFRI_HUB="${cfg.host}"
${inputs.traadfri.defaultPackage.x86_64-linux}/bin/traadfri $@
'')
]
++ lib.mapAttrsToList (name: value:
pkgs.writers.writeDashBin "traadfri-${name}" ''
exec traadfri --target Room ${toString value} "$@"
'')
cfg.rooms
++ lib.mapAttrsToList (name: value:
pkgs.writers.writeDashBin "traadfri-${name}" ''
exec traadfri --target Bulb ${toString value} "$@"
'')
cfg.bulbs;
};
}

Submodule secrets updated: aac75be4fd...0e94e9e2ef

View File

@@ -55,7 +55,6 @@ secrets/telegram-token-menstruation.age
secrets/telegram-token-nachtischsatan.age secrets/telegram-token-nachtischsatan.age
secrets/telegram-token-proverb.age secrets/telegram-token-proverb.age
secrets/telegram-token-reverse.age secrets/telegram-token-reverse.age
secrets/traadfri-key.age
secrets/weechat-sec.conf.age secrets/weechat-sec.conf.age
secrets/zaatar-moodle-dl-basicAuth.age secrets/zaatar-moodle-dl-basicAuth.age
secrets/zaatar-moodle-dl-tokens.json.age secrets/zaatar-moodle-dl-tokens.json.age