refactor(flake)!: machines
-> hosts
This commit is contained in:
parent
703cd0264b
commit
a881c5d7e1
33 changed files with 52 additions and 45 deletions
23
hosts/nixos/x86_64-linux/jeeves/home-assistant/android.nix
Normal file
23
hosts/nixos/x86_64-linux/jeeves/home-assistant/android.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
39
hosts/nixos/x86_64-linux/jeeves/home-assistant/default.nix
Normal file
39
hosts/nixos/x86_64-linux/jeeves/home-assistant/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ inputs, outputs, lib, pkgs, config, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"openssl-1.1.1w"
|
||||
];
|
||||
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
extraComponents = [
|
||||
# Components required to complete the onboarding
|
||||
"esphome"
|
||||
"met"
|
||||
"radio_browser"
|
||||
"tuya"
|
||||
];
|
||||
config = {
|
||||
# Includes dependencies for a basic setup
|
||||
# https://www.home-assistant.io/integrations/default_config/
|
||||
default_config = { };
|
||||
mobile_app = { };
|
||||
map = { };
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall =
|
||||
lib.pipe
|
||||
[ "TCP" "UDP" ]
|
||||
[
|
||||
(builtins.map
|
||||
(protocol:
|
||||
lib.nameValuePair
|
||||
"allowed${protocol}Ports"
|
||||
[ 8123 ]))
|
||||
builtins.listToAttrs
|
||||
];
|
||||
}
|
27
hosts/nixos/x86_64-linux/jeeves/home-assistant/jokes.nix
Normal file
27
hosts/nixos/x86_64-linux/jeeves/home-assistant/jokes.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue