rix101/hosts/nixos/jeeves/home-assistant/jokes.nix
reo101 9b8f894a1a
feat(configurations)!: flatten down, introduce meta.nix
Flatten down directory structure:
- From: `./hosts/${configuration-type}/${system}/{configuration,deploy}.nix`
-   To: `./hosts/${configuration-type}/{meta,configuration}.nix`
Keep `system` and `deploy-rs` config in `meta.nix`
Update `flake.lock`
2024-08-13 15:59:45 +03:00

27 lines
650 B
Nix

{
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";
};
};
};
}