rose-pine-nix/modules/nixos/grub.nix
seth 60a1d9ba22
refactor: use alternatives to with and rec (#38)
* fix(home-manager): dont declare xdg.configFile when btop isn't enabled

* refactor: use alternatives to `with` and `rec`

---------

Co-authored-by: Sam Nystrom <sam@samnystrom.dev>
2023-07-13 12:17:51 -04:00

32 lines
753 B
Nix

{ config
, pkgs
, lib
, ...
}:
let
cfg = config.boot.loader.grub.catppuccin;
enable = cfg.enable && config.boot.loader.grub.enable;
theme = with pkgs; let
src = fetchFromGitHub {
owner = "catppuccin";
repo = "grub";
rev = "803c5df0e83aba61668777bb96d90ab8f6847106";
sha256 = "sha256-/bSolCta8GCZ4lP0u5NVqYQ9Y3ZooYCNdTwORNvR7M0=";
};
in
runCommand "catppuccin-grub-theme" { } ''
mkdir -p "$out"
cp -r ${src}/src/catppuccin-${cfg.flavour}-grub-theme/* "$out"/
'';
in
{
options.boot.loader.grub.catppuccin =
lib.ctp.mkCatppuccinOpt "grub" config;
config.boot.loader.grub = lib.mkIf enable {
font = "${theme}/font.pf2";
splashImage = "${theme}/background.png";
inherit theme;
};
}