From f9d03f81f912db993555709ace3f440f3139b36a Mon Sep 17 00:00:00 2001 From: Anomalocaridid <29845794+Anomalocaridid@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:55:19 -0400 Subject: [PATCH] feat(home-manager): init mpv module (#95) --- _sources/generated.json | 20 ++++++++++++++++++++ _sources/generated.nix | 12 ++++++++++++ modules/home-manager/mpv.nix | 22 ++++++++++++++++++++++ nvfetcher.toml | 4 ++++ test.nix | 1 + 5 files changed, 59 insertions(+) create mode 100644 modules/home-manager/mpv.nix diff --git a/_sources/generated.json b/_sources/generated.json index d48e59c5..332a3ac2 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -439,6 +439,26 @@ }, "version": "ed8ef015f97c357575b5013e18042c9faa6c068a" }, + "mpv": { + "cargoLocks": null, + "date": "2024-04-09", + "extract": null, + "name": "mpv", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "catppuccin", + "repo": "mpv", + "rev": "db31f00b5107320f8882eb8c727060d5eab702c9", + "sha256": "sha256-QxPUjd2Y4FpvEg2aYrKkJVkLNfYtESryY+w5NNMUMZc=", + "type": "github" + }, + "version": "db31f00b5107320f8882eb8c727060d5eab702c9" + }, "neovim": { "cargoLocks": null, "date": "2024-03-29", diff --git a/_sources/generated.nix b/_sources/generated.nix index cf40d954..b3cbcb42 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -265,6 +265,18 @@ }; date = "2022-09-27"; }; + mpv = { + pname = "mpv"; + version = "db31f00b5107320f8882eb8c727060d5eab702c9"; + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "mpv"; + rev = "db31f00b5107320f8882eb8c727060d5eab702c9"; + fetchSubmodules = false; + sha256 = "sha256-QxPUjd2Y4FpvEg2aYrKkJVkLNfYtESryY+w5NNMUMZc="; + }; + date = "2024-04-09"; + }; neovim = { pname = "neovim"; version = "aebe43db9cb26e1c70fc5b2fd4158169c405e720"; diff --git a/modules/home-manager/mpv.nix b/modules/home-manager/mpv.nix new file mode 100644 index 00000000..a02fc646 --- /dev/null +++ b/modules/home-manager/mpv.nix @@ -0,0 +1,22 @@ +{ config +, lib +, sources +, ... +}: +let + cfg = config.programs.mpv.catppuccin; + enable = cfg.enable && config.programs.mpv.enable; + themeDir = sources.mpv + /themes/${cfg.flavour}/${cfg.accent}; +in +{ + options.programs.mpv.catppuccin = + lib.ctp.mkCatppuccinOpt "mpv" // { + accent = lib.ctp.mkAccentOpt "mpv"; + }; + + # Note that the theme is defined across multiple files + config.programs.mpv = lib.mkIf enable { + config = lib.ctp.fromINI (themeDir + "/mpv.conf"); + scriptOpts.stats = lib.ctp.fromINI (themeDir + "/script-opts/stats.conf"); + }; +} diff --git a/nvfetcher.toml b/nvfetcher.toml index aeff0a78..6d05c37c 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -86,6 +86,10 @@ fetch.github = "catppuccin/mako" src.git = "https://github.com/catppuccin/micro.git" fetch.github = "catppuccin/micro" +[mpv] +src.git = "https://github.com/catppuccin/mpv.git" +fetch.github = "catppuccin/mpv" + [neovim] src.git = "https://github.com/catppuccin/nvim.git" fetch.github = "catppuccin/nvim" diff --git a/test.nix b/test.nix index 38d62ecf..54695f64 100644 --- a/test.nix +++ b/test.nix @@ -78,6 +78,7 @@ in kitty = ctpEnable; lazygit = ctpEnable; micro = ctpEnable; + mpv = ctpEnable; neovim = ctpEnable; rio = ctpEnable; rofi = ctpEnable;