Skip to content

Commit

Permalink
grub: use sylix.imageScalingMode
Browse files Browse the repository at this point in the history
  • Loading branch information
justDeeevin committed Dec 13, 2024
1 parent 2335d41 commit 3a58f56
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/grub/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ let
${pkgs.grub2}/bin/grub-mkfont $font --output $out --size ${toString sizes.applications}
'';

inherit (config.stylix) imageScalingMode;

image-scale =
if imageScalingMode == "fill"
then "crop"
else if imageScalingMode == "fit"
then "fitheight"
else if imageScalingMode == "center"
then "padding"
# Grub doesn't seem to support tile
else "crop";
in {
options.stylix.targets.grub = {
enable = config.lib.stylix.mkEnableTarget "GRUB" true;
Expand All @@ -46,7 +57,7 @@ in {
theme = pkgs.runCommand "stylix-grub" {
themeTxt = ''
desktop-image: "background.png"
desktop-image-scale-method: "crop"
desktop-image-scale-method: "${image-scale}"
desktop-color: "${base00}"
title-text: ""
Expand Down

0 comments on commit 3a58f56

Please sign in to comment.