mirror of
				https://github.com/nmasur/dotfiles
				synced 2025-11-04 01:13:15 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			767 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			767 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  config,
 | 
						|
  pkgs,
 | 
						|
  lib,
 | 
						|
  ...
 | 
						|
}:
 | 
						|
 | 
						|
let
 | 
						|
  cfg = config.nmasur.presets.programs.mpv;
 | 
						|
in
 | 
						|
 | 
						|
{
 | 
						|
 | 
						|
  options.nmasur.presets.programs.mpv.enable = lib.mkEnableOption "mpv video player";
 | 
						|
 | 
						|
  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
 | 
						|
      ];
 | 
						|
    };
 | 
						|
 | 
						|
    programs.fish.shellAbbrs = {
 | 
						|
      mpvs = "mpv --shuffle=yes";
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |