mirror of
https://github.com/danth/stylix
synced 2024-11-22 12:13:08 +00:00
Implement useImage
option for GRUB ✨
Using Plymouth as the default value to retain backwards compatibility.
This commit is contained in:
parent
8cabaf34bf
commit
b96059664c
1 changed files with 14 additions and 3 deletions
|
@ -23,8 +23,19 @@ let
|
|||
'';
|
||||
|
||||
in {
|
||||
options.stylix.targets.grub.enable =
|
||||
config.lib.stylix.mkEnableTarget "GRUB" true;
|
||||
options.stylix.targets.grub = {
|
||||
enable = config.lib.stylix.mkEnableTarget "GRUB" true;
|
||||
|
||||
useImage = lib.mkOption {
|
||||
description = ''
|
||||
Whether to use your wallpaper image for the GRUB background.
|
||||
If this is disabled, a plain color will be used instead.
|
||||
'';
|
||||
type = lib.types.bool;
|
||||
default = config.stylix.targets.plymouth.enable;
|
||||
defaultText = lib.literalExpression "stylix.targets.plymouth.enable";
|
||||
};
|
||||
};
|
||||
|
||||
config.boot.loader.grub = lib.mkIf config.stylix.targets.grub.enable {
|
||||
backgroundColor = base00;
|
||||
|
@ -88,7 +99,7 @@ in {
|
|||
mkdir $out
|
||||
cp $themeTxtPath $out/theme.txt
|
||||
|
||||
${if config.boot.plymouth.enable
|
||||
${if config.stylix.targets.grub.useImage
|
||||
# Make sure the background image is .png by asking to convert it
|
||||
then
|
||||
"${pkgs.imagemagick}/bin/convert ${config.stylix.image} png32:$out/background.png"
|
||||
|
|
Loading…
Reference in a new issue