rose-pine-nix/modules/nixos/grub.nix
seth 28e6d8a18d
feat(modules): add catppuccin.sources option (#129)
* feat(modules): add `catppuccin.sources` option

* refactor(modules)!: nvfetcher -> npins

npins gives us a nicer file to import that is a simple name value pair
of the port and the path in the store. this allows for easier overriding
with the catppuccin.sources option

* fix(modules): ensure default sources are applied to `catppuccin.sources`
2024-05-13 16:33:16 -04:00

26 lines
647 B
Nix

{ config
, lib
, pkgs
, ...
}:
let
inherit (config.catppuccin) sources;
cfg = config.boot.loader.grub.catppuccin;
enable = cfg.enable && config.boot.loader.grub.enable;
# TODO @getchoo: upstream this in nixpkgs maybe? idk if they have grub themes
theme = pkgs.runCommand "catppuccin-grub-theme" { } ''
mkdir -p "$out"
cp -r ${sources.grub}/src/catppuccin-${cfg.flavour}-grub-theme/* "$out"/
'';
in
{
options.boot.loader.grub.catppuccin =
lib.ctp.mkCatppuccinOpt "grub";
config.boot.loader.grub = lib.mkIf enable {
font = "${theme}/font.pf2";
splashImage = "${theme}/background.png";
inherit theme;
};
}