nixos-configs/devices/homie/modules/home-assistant/spotify.nix

94 lines
1.9 KiB
Nix
Raw Normal View History

{
config,
pkgs,
self,
...
}: {
services.home-assistant = {
customComponents = builtins.attrValues {
inherit
(self.scopedPackages.${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 = {
2024-12-02 11:03:43 -05:00
async_action = false;
action = [
{
service = "netdaemon.spotify_play_album";
data = {
artist = "{{ artist }}";
album = "{{ album }}";
};
}
];
};
PlayArtist = {
2024-12-02 11:03:43 -05:00
async_action = false;
action = [
{
service = "netdaemon.spotify_play_artist";
data.artist = "{{ artist }}";
}
];
};
PlayPlaylist = {
2024-12-02 11:03:43 -05:00
async_action = false;
action = [
{
service = "netdaemon.spotify_play_playlist";
data.playlist = "{{ playlist }}";
}
];
};
PlaySong = {
2024-12-02 11:03:43 -05:00
async_action = false;
action = [
{
service = "netdaemon.spotify_play_song";
data = {
artist = "{{ artist }}";
song = "{{ song }}";
};
}
];
};
2024-12-02 11:03:43 -05:00
Pause = {
async_action = false;
action = [
{
service = "netdaemon.spotify_pause_unpause";
data.pause = true;
}
];
};
Unpause = {
async_action = false;
action = [
{
service = "netdaemon.spotify_pause_unpause";
data.pause = false;
}
];
};
};
};
}