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:
parent
a144c723a1
commit
d5e73c39fc
1 changed files with 14 additions and 1 deletions
|
@ -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 = ''
|
||||||
|
|
Loading…
Reference in a new issue