feat(mako): Catppuccin -> Rose Pine
This commit is contained in:
parent
bf5eb17672
commit
f8c7812f4f
2 changed files with 22 additions and 20 deletions
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue