spotifyd: add package option

This option can be used to enable optional Spotifyd features, such as
looking up the Spotify password in the system keyring or enabling
MPRIS support.

PR #1390
This commit is contained in:
Sergei Maximov 2020-07-15 15:01:01 +03:00 committed by Robert Helgesson
parent 3f1be69359
commit 5cd7865c6c
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -14,6 +14,18 @@ in {
options.services.spotifyd = {
enable = mkEnableOption "SpotifyD connect";
package = mkOption {
type = types.package;
default = pkgs.spotifyd;
defaultText = literalExample "pkgs.spotifyd";
example =
literalExample "(pkgs.spotifyd.override { withKeyring = true; })";
description = ''
The <literal>spotifyd</literal> package to use.
Can be used to specify extensions.
'';
};
settings = mkOption {
type = types.attrsOf (types.attrsOf types.str);
default = { };
@ -31,7 +43,7 @@ in {
};
config = mkIf cfg.enable {
home.packages = [ pkgs.spotifyd ];
home.packages = [ cfg.package ];
systemd.user.services.spotifyd = {
Unit = {
@ -43,7 +55,7 @@ in {
Service = {
ExecStart =
"${pkgs.spotifyd}/bin/spotifyd --no-daemon --config-path ${configFile}";
"${cfg.package}/bin/spotifyd --no-daemon --config-path ${configFile}";
Restart = "always";
RestartSec = 12;
};