diff --git a/modules/mpv/hm.nix b/modules/mpv/hm.nix index 8c95ffe7..7cc67582 100644 --- a/modules/mpv/hm.nix +++ b/modules/mpv/hm.nix @@ -1,50 +1,61 @@ -{ lib, config, ... }: -{ - options.stylix.targets.mpv.enable = config.lib.stylix.mkEnableTarget "mpv" true; - - config = lib.mkIf (config.stylix.enable && config.stylix.targets.mpv.enable) { - programs.mpv = { - config = with config.lib.stylix.colors.withHashtag; { - osd-font = config.stylix.fonts.sansSerif.name; - sub-font = config.stylix.fonts.sansSerif.name; - - background-color = "#000000"; - osd-back-color = base01; - osd-border-color = base01; - osd-color = base05; - osd-shadow-color = base00; - }; - - scriptOpts = { - uosc.color = - with config.lib.stylix.colors; - lib.concatMapAttrsStringSep "," (name: value: "${name}=${value}") { - background = base00; - background_text = base05; - foreground = base05; - foreground_text = base00; - success = base0B; - error = base08; +{ mkTarget, lib, ... }: +mkTarget { + name = "mpv"; + humanName = "mpv"; + configElements = [ + ( + { fonts }: + { + programs.mpv.config = { + osd-font = fonts.sansSerif.name; + sub-font = fonts.sansSerif.name; + }; + } + ) + ( + { colors }: + { + programs.mpv = { + config = with colors.withHashtag; { + background-color = "#000000"; + osd-back-color = base01; + osd-border-color = base01; + osd-color = base05; + osd-shadow-color = base00; }; - modernz = with config.lib.stylix.colors.withHashtag; { - seekbarfg_color = base0D; - seekbarbg_color = base03; - seekbar_cache_color = base03; - window_title_color = base03; - window_controls_color = base03; + scriptOpts = { + uosc.color = + with colors; + lib.concatMapAttrsStringSep "," (name: value: "${name}=${value}") { + background = base00; + background_text = base05; + foreground = base05; + foreground_text = base00; + success = base0B; + error = base08; + }; - title_color = base05; - time_color = base05; - chapter_title_color = base05; - cache_info_color = base05; + modernz = with colors.withHashtag; { + seekbarfg_color = base0D; + seekbarbg_color = base03; + seekbar_cache_color = base03; + window_title_color = base03; + window_controls_color = base03; - middle_buttons_color = base0D; - side_buttons_color = base03; - playpause_color = base0D; - hover_effect_color = base0E; + title_color = base05; + time_color = base05; + chapter_title_color = base05; + cache_info_color = base05; + + middle_buttons_color = base0D; + side_buttons_color = base03; + playpause_color = base0D; + hover_effect_color = base0E; + }; + }; }; - }; - }; - }; + } + ) + ]; }