2021-07-29 20:21:51 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2021-08-02 19:51:25 +00:00
|
|
|
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";
|
2021-08-02 19:51:25 +00:00
|
|
|
} // 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 = {
|
2021-08-02 19:51:25 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|