add gpu option to mpv wrapper

This commit is contained in:
jacekpoz 2024-05-05 19:13:38 +02:00
parent 3c1ac52780
commit dbc53ceeba
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
2 changed files with 15 additions and 4 deletions

View file

@ -151,7 +151,10 @@
};
};
foot.enable = true;
mpv.enable = true;
mpv = {
enable = true;
gpu = "AMD Radeon RX 6800M (RADV NAVI22)";
};
neovim.enable = true;
zathura.enable = true;
hypr = {

View file

@ -7,9 +7,17 @@
cfg = config.myOptions.programs.mpv;
inherit (config.myOptions.other.system) username;
inherit (lib) mkEnableOption mkIf;
inherit (lib) mkEnableOption mkIf mkOption;
inherit (lib.types) nullOr str;
in {
options.myOptions.programs.mpv.enable = mkEnableOption "mpv";
options.myOptions.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} = {
@ -19,7 +27,7 @@ in {
vo = "gpu-next";
hwdec = "auto";
gpu-api = "vulkan";
vulkan-device = "AMD Radeon RX 6800M (RADV NAVI22)";
vulkan-device = mkIf (cfg.gpu != null) cfg.gpu;
volume = 50;
osc = "no";
osd-bar = "no";