feat: add mpv module

This commit is contained in:
Dmitriy Kholkin 2025-06-07 21:31:32 +03:00
parent e879182969
commit f46004e976
Signed by: AtaraxiaDev
GPG Key ID: FD266B810DF48DF2
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,39 @@
{
config,
lib,
osConfig ? null,
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.ataraxia.programs.mpv;
gpu = if (osConfig != null) then osConfig.ataraxia.defaults.hardware.gpuVendor else null;
in
{
options.ataraxia.programs.mpv = {
enable = mkEnableOption "Enable mpv program";
};
config = mkIf cfg.enable {
programs.mpv = {
enable = true;
config = {
vo = "gpu-next";
gpu-context = "wayland";
save-position-on-quit = "yes";
hwdec = if gpu == "nvidia" then "vdpau" else "vaapi";
};
};
defaultApplications.media-player = {
cmd = "${config.programs.mpv.package}/bin/mpv";
desktop = "mpv";
};
persist.state.directories = [
".config/mpv"
];
};
}

View File

@ -81,6 +81,7 @@ in
ataraxia.programs.default.enable = mkDefault true;
ataraxia.programs.firefox.enable = mkDefault true;
ataraxia.programs.kitty.enable = mkDefault true;
ataraxia.programs.mpv.enable = mkDefault true;
ataraxia.programs.vscode.enable = mkDefault true;
ataraxia.wayland.enable = mkDefault true;
ataraxia.wayland.hyprland.enable = mkDefault true;