{ secrets, lib, ty-home-manager-options, ... }: { config = lib.mkIf ty-home-manager-options.rescrobbled.enable { services.custom.rescrobbled = let s = secrets.programs.rescrobbled; in lib.mkIf s.enable { enable = true; session = s.lastfm.session; settings = { player-whitelist = [ "elisa" ]; listenbrainz = lib.mkIf (s.listenbrainz.token != null) [ { token = s.listenbrainz.token; } ]; lastfm-key = lib.mkIf (s.lastfm.key != null && s.lastfm.secret != null) s.lastfm.key; lastfm-secret = lib.mkIf (s.lastfm.key != null && s.lastfm.secret != null) s.lastfm.secret; }; }; }; }