mpv: add scripts option

This commit is contained in:
dawidsowa 2019-09-02 17:52:02 +02:00 committed by Robert Helgesson
parent a144c723a1
commit d5e73c39fc
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -54,6 +54,15 @@ in {
programs.mpv = { programs.mpv = {
enable = mkEnableOption "mpv"; enable = mkEnableOption "mpv";
scripts = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.mpvScripts.mpris ]";
description = ''
List of scripts to use with mpv.
'';
};
config = mkOption { config = mkOption {
description = '' description = ''
Configuration written to Configuration written to
@ -122,7 +131,11 @@ in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
{ {
home.packages = [ pkgs.mpv ]; home.packages = [(
if cfg.scripts == []
then pkgs.mpv
else pkgs.mpv-with-scripts.override { scripts = cfg.scripts; }
)];
} }
(mkIf (cfg.config != {} || cfg.profiles != {}) { (mkIf (cfg.config != {} || cfg.profiles != {}) {
xdg.configFile."mpv/mpv.conf".text = '' xdg.configFile."mpv/mpv.conf".text = ''