feat(jeeves): home-assistant modularization

This commit is contained in:
reo101 2024-04-13 13:37:24 +03:00
parent ee98e1582c
commit 16457e0a09
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
6 changed files with 200 additions and 153 deletions

View file

@ -10,14 +10,15 @@
./wireguard.nix
./jellyfin.nix
./mindustry.nix
./home-assistant.nix
./home-assistant
./samba.nix
];
age.rekey = {
hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPopSTZ81UyKp9JSljCLp+Syk51zacjh9fLteqxQ6/aB";
masterIdentities = [ "${inputs.self}/secrets/privkey.age" ];
# forceRekeyOnSystem = "aarch64-darwin";
storageMode = "derivation";
# forceRekeyOnSystem = "aarch64-linux";
};
nixpkgs = {
@ -34,9 +35,15 @@
boot = {
loader.systemd-boot.enable = true;
kernelPackages = pkgs.linuxPackages_latest;
initrd.availableKernelModules = [
"nvme"
];
binfmt.emulatedSystems = [ "aarch64-linux" ];
initrd = {
availableKernelModules = [
"nvme"
];
# kernelModules = [
# "amdgpu"
# ];
};
};
hardware.enableRedistributableFirmware = true;

View file

@ -0,0 +1,23 @@
{
services.home-assistant.config = {
conversation.intents = {
FindAndroid = [
"(Find|Fight) my (phone|android|android phone)"
];
};
intent_script = {
FindAndroid = {
speech.text = "Send notification";
action = {
service = "notify.pushover";
data = {
message = "Phonefinderalert";
target = "android";
data.sound = "echo";
data.priority = 1;
};
};
};
};
};
}

View file

@ -14,11 +14,26 @@
"esphome"
"met"
"radio_browser"
"tuya"
];
config = {
# Includes dependencies for a basic setup
# https://www.home-assistant.io/integrations/default_config/
default_config = {};
default_config = { };
mobile_app = { };
map = { };
};
};
networking.firewall =
lib.pipe
[ "TCP" "UDP" ]
[
(builtins.map
(protocol:
lib.nameValuePair
"allowed${protocol}Ports"
[ 8123 ]))
builtins.listToAttrs
];
}

View file

@ -0,0 +1,27 @@
{
services.home-assistant.config = {
conversation.intents = {
TellJoke = [
"Tell [me] (a joke|something funny|a dad joke)"
];
};
sensor = [
{
name = "random_joke";
platform = "rest";
json_attributes = "joke";
resource = "https://icanhazdadjoke.com/";
scan_interval = "3600";
headers.Accept = "application/json";
}
];
intent_script.TellJoke = {
speech.text = ''{{ state_attr("sensor.random_joke", "joke") }}'';
action = {
service = "homeassistant.update_entity";
entity_id = "sensor.random_joke";
};
};
};
}

View file

@ -1,6 +1,6 @@
{ lib, pkgs, config, ... }:
{
reo101.mindustry = {
enable = true;
enable = false;
};
}