Convert MPV configuration to module

This commit is contained in:
Yorick Barbanneau 2023-12-30 18:22:35 +01:00
parent e2df40e518
commit d48773e9af
5 changed files with 26 additions and 6 deletions

View file

@ -9,6 +9,7 @@
./desktop/sway
./gaming/lutris
./video/kdenlive
./video/mpv
./web/firefox
./web/qutebrowser/default.nix
./web/webcord

View file

@ -0,0 +1,24 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.video.mpv;
in
{
options.modules.video.mpv = {
enable = mkEnableOption "enable MPV video player";
};
config = mkIf cfg.enable {
programs.mpv = {
enable = true;
config = {
hwdec = auto-safe;
vo = gpu;
profile = gpu-hq;
gpu-context = wayland;
};
};
xdg.mimeApps.defaultApplications = {
"video/*" = "mpv.desktop";
};
};
}