1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01:00

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 = {
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 {
description = ''
Configuration written to
@ -122,7 +131,11 @@ in {
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 != {}) {
xdg.configFile."mpv/mpv.conf".text = ''