mpv: add extraInput option

This commit is contained in:
Lichthagel 2024-04-29 15:49:58 +02:00 committed by Robert Helgesson
parent 2af7c78b7b
commit b8d81ef15e
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
3 changed files with 25 additions and 3 deletions

View file

@ -176,6 +176,20 @@ in {
}
'';
};
extraInput = mkOption {
description = ''
Additional lines that are appended to {file}`$XDG_CONFIG_HOME/mpv/input.conf`.
See {manpage}`mpv(1)` for the full list of options.
'';
type = with types; lines;
default = "";
example = ''
esc quit #! Quit
# script-binding uosc/video #! Video tracks
# additional comments
'';
};
};
};
@ -199,8 +213,11 @@ in {
${optionalString (cfg.profiles != { }) (renderProfiles cfg.profiles)}
'';
})
(mkIf (cfg.bindings != { }) {
xdg.configFile."mpv/input.conf".text = renderBindings cfg.bindings;
(mkIf (cfg.bindings != { } || cfg.extraInput != "") {
xdg.configFile."mpv/input.conf".text = mkMerge [
(mkIf (cfg.bindings != { }) (renderBindings cfg.bindings))
(mkIf (cfg.extraInput != "") cfg.extraInput)
];
})
{
xdg.configFile = mapAttrs' (name: value: