nixos-config/modules/programs/mpv/default.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2021-07-29 20:21:51 +00:00
{ pkgs, ... }:
let
makeMpvProfile = { shader, additional ? {} }: {
2021-07-29 20:21:51 +00:00
glsl-shaders = "~/.config/mpv/shaders/${shader}";
scale = "ewa_lanczossharp";
cscale = "ewa_lanczossharp";
gpu-context = "auto";
gpu-api = "opengl";
hwdec = "vaapi";
vo = "gpu";
video-sync = "display-resample";
interpolation = "";
tscale = "oversample";
} // additional;
2021-07-29 20:21:51 +00:00
in {
environment.systemPackages = [ pkgs.mpv ];
home-manager.users.alexander = {
xdg.configFile = {
"mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl".source = ./shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl;
"mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl".source = ./shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl;
};
programs.mpv = {
enable = true;
config = {
script-opts = "try_ytdl_first=no";
};
defaultProfiles = [ "anime" ];
profiles = {
anime = (makeMpvProfile {
shader = "Anime4K_Upscale_CNN_UL_x2_Deblur.glsl";
additional = {
fullscreen = "";
};
});
"anime-denoise" = (makeMpvProfile {
shader = "Anime4K_Upscale_CNN_UL_x2_Denoise.glsl";
});
2021-07-29 20:21:51 +00:00
};
};
};
}