nixos-configs/devices/homie/modules/home-assistant/spotify.nix
matt1432 8bcb9c43ad
All checks were successful
Discord / discord commits (push) Has been skipped
feat(hass): extend options of services with configFiles
2024-10-09 23:14:05 -04:00

73 lines
1.5 KiB
Nix

{
config,
pkgs,
self,
...
}: {
services.home-assistant = {
customComponents = builtins.attrValues {
inherit
(self.legacyPackages.${pkgs.system}.hass-components)
spotifyplus
;
};
extraComponents = [
"spotify"
];
customSentences."assist_spotify" = import ./spotify-sentences.nix;
configFiles.
".storage/SpotifyWebApiPython_librespot_credentials.json"
.source = config.sops.secrets.spotifyd.path;
config.intent_script = {
PlayAlbum = {
async_action = "false";
action = [
{
service = "netdaemon.spotify_play_album";
data = {
artist = "{{ artist }}";
album = "{{ album }}";
};
}
];
};
PlayArtist = {
async_action = "false";
action = [
{
service = "netdaemon.spotify_play_artist";
data.artist = "{{ artist }}";
}
];
};
PlayPlaylist = {
async_action = "false";
action = [
{
service = "netdaemon.spotify_play_playlist";
data.playlist = "{{ playlist }}";
}
];
};
PlaySong = {
async_action = "false";
action = [
{
service = "netdaemon.spotify_play_song";
data = {
artist = "{{ artist }}";
song = "{{ song }}";
};
}
];
};
};
};
}