Spotify: Difference between revisions

From NixOS Wiki
imported>Valodim
add info about spotifyd
imported>Aaronpkelly
add info about spotifyd needing credentials when starting
Line 10: Line 10:
=== spotifyd ===
=== spotifyd ===
The alternative client [https://github.com/Spotifyd/spotifyd spotifyd] is available as a package, [https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/audio/spotifyd.nix nixos module], and [https://github.com/nix-community/home-manager/blob/master/modules/services/spotifyd.nix home-manager module].
The alternative client [https://github.com/Spotifyd/spotifyd spotifyd] is available as a package, [https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/audio/spotifyd.nix nixos module], and [https://github.com/nix-community/home-manager/blob/master/modules/services/spotifyd.nix home-manager module].
spotifyd must have your credentials when it starts, otherwise it will not be able to authenticate with Spotify, and will not show up as a device. If installing spotifyd as a package, give it credentials when starting, e.g.:
spotifyd --username <USER> --password <PASS>
If installing spotifyd via home-manager, you can supply your credentials via options. Example home-manager config:
  services.spotifyd = {
    enable = true;
    settings =
      {
        global = {
          username = "Alex";
          password = "foo";
        };
      }
    ;
  }


spotifyd connects to spotify as a spotify-connect device. It offers no controls of its own, but can be controlled via [https://github.com/altdesktop/playerctl playerctl]  or [https://github.com/Rigellute/spotify-tui spotify-tui].
spotifyd connects to spotify as a spotify-connect device. It offers no controls of its own, but can be controlled via [https://github.com/altdesktop/playerctl playerctl]  or [https://github.com/Rigellute/spotify-tui spotify-tui].

Revision as of 22:17, 5 March 2023

Spotify

Note: Spotify is unfree, its license prohibits distribution. See the FAQ/unfree page to install unfree software.

Local discovery

To sync local tracks from your filesystem with mobile devices in the same network, you need to open port 57621 by adding the following line to your configuration.nix:

networking.firewall.allowedTCPPorts = [ 57621 ];

spotifyd

The alternative client spotifyd is available as a package, nixos module, and home-manager module.

spotifyd must have your credentials when it starts, otherwise it will not be able to authenticate with Spotify, and will not show up as a device. If installing spotifyd as a package, give it credentials when starting, e.g.:

spotifyd --username <USER> --password <PASS>

If installing spotifyd via home-manager, you can supply your credentials via options. Example home-manager config:

 services.spotifyd = {
   enable = true;
   settings =
     {
       global = {
         username = "Alex";
         password = "foo";
       };
     }
   ;
 }

spotifyd connects to spotify as a spotify-connect device. It offers no controls of its own, but can be controlled via playerctl or spotify-tui.