From 99fbae0ec5a9debd00fcc1a6e6e655d62fcaa992 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 2 Oct 2020 13:49:40 -0700 Subject: [PATCH] mpd: configurable executable package --- modules/services/mpd.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index 13b3ae78f26..3f05c22a336 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -41,6 +41,15 @@ in { ''; }; + package = mkOption { + type = types.package; + default = pkgs.mpd; + defaultText = "pkgs.mpd"; + description = '' + The MPD package to run. + ''; + }; + musicDirectory = mkOption { type = with types; either path str; default = "${config.home.homeDirectory}/music"; @@ -140,7 +149,7 @@ in { Service = { Environment = "PATH=${config.home.profileDirectory}/bin"; - ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdConf}"; + ExecStart = "${cfg.package}/bin/mpd --no-daemon ${mpdConf}"; Type = "notify"; ExecStartPre = ''${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p '${cfg.dataDir}' '${cfg.playlistDirectory}'"''; };