From 5cd7865c6cea1d56cf7b8b5ef5a01544ab6c1ab3 Mon Sep 17 00:00:00 2001 From: Sergei Maximov Date: Wed, 15 Jul 2020 15:01:01 +0300 Subject: 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 --- modules/services/spotifyd.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/services/spotifyd.nix b/modules/services/spotifyd.nix index 730a46e135f..dfe0ecd318e 100644 --- a/modules/services/spotifyd.nix +++ b/modules/services/spotifyd.nix @@ -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 spotifyd 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; }; -- cgit v1.2.3