36 lines
692 B
Nix
Raw Normal View History

2025-01-20 22:35:40 -05:00
{
config,
pkgs,
lib,
...
}:
let
2025-02-17 14:05:23 -05:00
cfg = config.nmasur.presets.programs.mpv;
2025-01-20 22:35:40 -05:00
in
{
2025-02-17 14:05:23 -05:00
options.nmasur.presets.programs.mpv.enable = lib.mkEnableOption "mpv video player";
2025-01-20 22:35:40 -05:00
config = lib.mkIf cfg.enable {
# Video player
programs.mpv = {
enable = true;
bindings = { };
config = {
image-display-duration = 2; # For cycling through images
hwdec = "auto-safe"; # Attempt to use GPU decoding for video
};
scripts = [
# Automatically load playlist entries before and after current file
pkgs.mpvScripts.autoload
# Delete current file after quitting
pkgs.mpvScripts.mpv-delete-file
];
};
};
}