From f8c7812f4ff51bd269a45ef69615d4d60734222f Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 20 Oct 2024 11:23:59 -0700 Subject: [PATCH] feat(mako): Catppuccin -> Rose Pine --- .sources/sources.json | 10 +++++----- modules/home-manager/mako.nix | 32 +++++++++++++++++--------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.sources/sources.json b/.sources/sources.json index 0e126bc..60f188c 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -184,13 +184,13 @@ "type": "Git", "repository": { "type": "GitHub", - "owner": "catppuccin", + "owner": "rose-pine", "repo": "mako" }, "branch": "main", - "revision": "92844f144e72f2dc8727879ec141ffdacf3ff6a1", - "url": "https://github.com/catppuccin/mako/archive/92844f144e72f2dc8727879ec141ffdacf3ff6a1.tar.gz", - "hash": "0nz5x66bv0nhmgh2slw647j69x7pqcw0cyclkpv3bq6c5bw9j24f" + "revision": "07bc71ed12be3ce7d0b728eee58c5e183f78f40e", + "url": "https://github.com/rose-pine/mako/archive/07bc71ed12be3ce7d0b728eee58c5e183f78f40e.tar.gz", + "hash": "0xxkj2x4nz6qkdjdfr5fddb24ab51519xnai63x62zlij0fzgdq0" }, "micro": { "type": "Git", @@ -446,4 +446,4 @@ } }, "version": 3 -} +} \ No newline at end of file diff --git a/modules/home-manager/mako.nix b/modules/home-manager/mako.nix index 68ec305..3d0a1a9 100644 --- a/modules/home-manager/mako.nix +++ b/modules/home-manager/mako.nix @@ -3,31 +3,33 @@ pkgs, lib, ... -}: -let - inherit (config.catppuccin) sources; - cfg = config.services.mako.catppuccin; +}: let + inherit (config.rose-pine) sources; + + cfg = config.services.mako.rose-pine; enable = cfg.enable && config.services.mako.enable; - theme = lib.ctp.fromINI ( - sources.mako + "/themes/catppuccin-${cfg.flavor}/catppuccin-${cfg.flavor}-${cfg.accent}" - ); + + themeName = + if (cfg.flavor == "main") + then "rose-pine" + else "rose-pine-${cfg.flavor}"; + theme = lib.rp.fromINI (sources.mako + "/theme/${themeName}.theme"); # Settings that need to be extracted and put in extraConfig - extraConfigAttrs = lib.attrsets.getAttrs [ "urgency=high" ] theme; -in -{ - options.services.mako.catppuccin = lib.ctp.mkCatppuccinOpt { name = "mako"; } // { - accent = lib.ctp.mkAccentOpt "mako"; - }; + extraConfigAttrs = lib.attrsets.getAttrs ["urgency=high"] theme; +in { + options.services.mako.rose-pine = + lib.rp.mkRosePineOpt {name = "mako";}; - # Will cause infinite recursion if config.services.mako is directly set as a whole + # Will cause infinite recursion if config.services.mako is directly set as a + # whole. config.services.mako = lib.mkIf enable { backgroundColor = theme.background-color; textColor = theme.text-color; borderColor = theme.border-color; progressColor = theme.progress-color; extraConfig = builtins.readFile ( - (pkgs.formats.ini { }).generate "mako-extra-config" extraConfigAttrs + (pkgs.formats.ini {}).generate "mako-extra-config" extraConfigAttrs ); }; }