2023-07-13 09:17:51 -07:00
|
|
|
{ config
|
|
|
|
, lib
|
2023-11-02 10:55:47 -07:00
|
|
|
, pkgs
|
2023-07-13 09:17:51 -07:00
|
|
|
, ...
|
|
|
|
}:
|
2023-04-16 13:11:09 -07:00
|
|
|
let
|
2024-05-13 13:33:16 -07:00
|
|
|
inherit (config.catppuccin) sources;
|
2023-04-16 13:11:09 -07:00
|
|
|
cfg = config.boot.loader.grub.catppuccin;
|
2023-07-13 09:17:51 -07:00
|
|
|
enable = cfg.enable && config.boot.loader.grub.enable;
|
2023-04-16 13:11:09 -07:00
|
|
|
|
2023-11-02 10:55:47 -07:00
|
|
|
# TODO @getchoo: upstream this in nixpkgs maybe? idk if they have grub themes
|
|
|
|
theme = pkgs.runCommand "catppuccin-grub-theme" { } ''
|
2023-07-13 09:17:51 -07:00
|
|
|
mkdir -p "$out"
|
2023-11-02 10:55:47 -07:00
|
|
|
cp -r ${sources.grub}/src/catppuccin-${cfg.flavour}-grub-theme/* "$out"/
|
2023-07-13 09:17:51 -07:00
|
|
|
'';
|
2023-04-18 17:01:16 -07:00
|
|
|
in
|
|
|
|
{
|
2023-04-17 18:50:53 -07:00
|
|
|
options.boot.loader.grub.catppuccin =
|
2023-11-02 10:55:47 -07:00
|
|
|
lib.ctp.mkCatppuccinOpt "grub";
|
2023-04-16 13:11:09 -07:00
|
|
|
|
2023-07-13 09:17:51 -07:00
|
|
|
config.boot.loader.grub = lib.mkIf enable {
|
2023-04-16 13:11:09 -07:00
|
|
|
font = "${theme}/font.pf2";
|
|
|
|
splashImage = "${theme}/background.png";
|
|
|
|
inherit theme;
|
|
|
|
};
|
|
|
|
}
|