mpv: init (#949)

Closes: https://github.com/danth/stylix/issues/185
Closes: https://github.com/danth/stylix/issues/186
Link: https://github.com/danth/stylix/pull/949

Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
awwpotato 2025-03-10 07:24:10 -07:00 committed by GitHub
parent 6a7d563370
commit 6c42dc31ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 70 additions and 0 deletions

33
modules/mpv/hm.nix Normal file
View file

@ -0,0 +1,33 @@
{ 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.monospace.name;
sub-font = config.stylix.fonts.monospace.name;
osd-font-size = config.stylix.fonts.sizes.applications;
sub-font-size = config.stylix.fonts.sizes.applications;
background-color = base00;
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;
curtain = base0D;
success = base0A;
error = base0F;
};
};
};
}

View file

@ -0,0 +1,18 @@
{ lib, pkgs, ... }:
let
package = pkgs.mpv;
in
{
stylix.testbed.application = {
enable = true;
name = "mpv";
inherit package;
};
home-manager.sharedModules = lib.singleton {
programs.mpv = {
enable = true;
inherit package;
};
};
}

View file

@ -0,0 +1,19 @@
{ lib, pkgs, ... }:
let
package = pkgs.mpv;
in
{
stylix.testbed.application = {
enable = true;
name = "mpv";
inherit package;
};
home-manager.sharedModules = lib.singleton {
programs.mpv = {
enable = true;
inherit package;
scripts = [ pkgs.mpvScripts.uosc ];
};
};
}