1 { config, lib, pkgs, ... }:
6 cfg = config.services.spotifyd;
7 toml = pkgs.formats.toml {};
10 then lib.trace "Using the stringly typed .config attribute is discouraged. Use the TOML typed .settings attribute instead."
14 then toml.generate "spotify.conf" cfg.settings
15 else warnConfig (pkgs.writeText "spotifyd.conf" cfg.config);
20 enable = mkEnableOption "spotifyd, a Spotify playing daemon";
26 (Deprecated) Configuration for Spotifyd. For syntax and directives, see
27 <https://docs.spotifyd.rs/config/File.html>.
34 example = { global.bitrate = 320; };
36 Configuration for Spotifyd. For syntax and directives, see
37 <https://docs.spotifyd.rs/config/File.html>.
43 config = mkIf cfg.enable {
46 assertion = cfg.config == "" || cfg.settings == {};
47 message = "At most one of the .config attribute and the .settings attribute may be set";
51 systemd.services.spotifyd = {
52 wantedBy = [ "multi-user.target" ];
53 wants = [ "network-online.target" ];
54 after = [ "network-online.target" "sound.target" ];
55 description = "spotifyd, a Spotify playing daemon";
56 environment.SHELL = "/bin/sh";
58 ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --cache-path /var/cache/spotifyd --config-path ${spotifydConf}";
62 CacheDirectory = "spotifyd";
63 SupplementaryGroups = ["audio"];
68 meta.maintainers = [ maintainers.anderslundstedt ];