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

@ -1,5 +0,0 @@
_: {
programs.mpv = {
enable = true;
};
}

View file

@ -2,6 +2,7 @@
config.modules = {
application = {
zathura.enable = true;
mpv.enable = true;
};
cli.neovim.enable = true;
cli.vifm.enable = true;

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";
};
};
}

View file

@ -67,7 +67,6 @@
] ++ (if hostConfig.desktop then
[
../home-manager/foot.nix
../home-manager/mpv
]
else []
) ++ lib.optional (