My NixOS config.
1{ config, lib, ... }:
2{
3 options.custom.home.spotifyd = lib.mkOption
4 { type = lib.types.bool;
5 default = false;
6 description = "enable spotifyd user service.";
7 };
8
9 config = lib.mkIf config.custom.home.spotifyd
10 {
11 networking.firewall =
12 { allowedTCPPorts = [ 1234 ];
13 allowedUDPPorts = [ 5353 ];
14 };
15
16 home-manager.users.paul = { osConfig, ... }:
17 { services.spotifyd =
18 { enable = true;
19 settings.global =
20 { device_name = osConfig.networking.hostName;
21 bitrate = 320;
22 cache_path = "/home/paul/.cache/spotifyd";
23 device_type = "a_v_r";
24 zeroconf_port = 1234;
25 };
26 };
27 };
28 };
29}