niksos/modules/gui/mpv.nix
2024-08-06 17:46:57 +02:00

46 lines
1.2 KiB
Nix

{
config,
lib,
pkgs,
...
}: let
cfg = config.poz.programs.mpv;
inherit (config.poz.other.system) username;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) nullOr str;
in {
options.poz.programs.mpv = {
enable = mkEnableOption "mpv";
gpu = mkOption {
description = "gpu used to render videos played through mpv";
type = nullOr str;
default = null;
};
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.mpv = {
enable = true;
config = {
vo = "gpu-next";
hwdec = "auto";
gpu-api = "vulkan";
vulkan-device = mkIf (cfg.gpu != null) cfg.gpu;
volume = 50;
osc = "no";
osd-bar = "no";
border = "no";
};
scripts = with pkgs.mpvScripts; [
mpris
thumbfast
sponsorblock
uosc
];
};
};
};
}