mirror of
https://github.com/vinceliuice/grub2-themes.git
synced 2024-12-25 06:15:35 +01:00
Added footer and enable option
This commit is contained in:
parent
2fd6eb9b66
commit
4f3b99cdf3
34
flake.nix
34
flake.nix
@ -34,6 +34,13 @@
|
|||||||
--screen ${cfg.screen} \
|
--screen ${cfg.screen} \
|
||||||
--theme ${cfg.theme} \
|
--theme ${cfg.theme} \
|
||||||
--icon ${cfg.icon};
|
--icon ${cfg.icon};
|
||||||
|
|
||||||
|
if [ -f ${cfg.splashImage} ]; then
|
||||||
|
cp ${cfg.splashImage} $out/grub/themes/${cfg.theme}/background.jpg;
|
||||||
|
fi;
|
||||||
|
if [ ${pkgs.lib.trivial.boolToString cfg.footer} == "false" ]; then
|
||||||
|
sed -i ':again;$!N;$!b again; s/\+ image {[^}]*}//g' $out/grub/themes/${cfg.theme}/theme.txt;
|
||||||
|
fi;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
resolution = resolutions."${cfg.screen}";
|
resolution = resolutions."${cfg.screen}";
|
||||||
@ -41,6 +48,14 @@
|
|||||||
rec {
|
rec {
|
||||||
options = {
|
options = {
|
||||||
boot.loader.grub2-theme = {
|
boot.loader.grub2-theme = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = true;
|
||||||
|
example = true;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Enable grub2 theming
|
||||||
|
'';
|
||||||
|
};
|
||||||
theme = mkOption {
|
theme = mkOption {
|
||||||
default = "tela";
|
default = "tela";
|
||||||
example = "tela";
|
example = "tela";
|
||||||
@ -68,14 +83,22 @@
|
|||||||
splashImage = mkOption {
|
splashImage = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
example = "/my/path/background.jpg";
|
example = "/my/path/background.jpg";
|
||||||
type = types.string;
|
type = types.path;
|
||||||
description = ''
|
description = ''
|
||||||
The path of the image to use for background (must be jpg).
|
The path of the image to use for background (must be jpg).
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
footer = mkOption {
|
||||||
|
default = true;
|
||||||
|
example = true;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Whether to include the image footer.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkMerge [{
|
config = mkIf cfg.enable (mkMerge [{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
grub2-theme
|
grub2-theme
|
||||||
];
|
];
|
||||||
@ -84,8 +107,13 @@
|
|||||||
splashImage = "${grub2-theme}/grub/themes/${cfg.theme}/background.jpg";
|
splashImage = "${grub2-theme}/grub/themes/${cfg.theme}/background.jpg";
|
||||||
gfxmodeEfi = "${resolution},auto";
|
gfxmodeEfi = "${resolution},auto";
|
||||||
gfxmodeBios = "${resolution},auto";
|
gfxmodeBios = "${resolution},auto";
|
||||||
|
extraConfig = ''
|
||||||
|
insmod gfxterm
|
||||||
|
insmod png
|
||||||
|
set icondir=($root)/theme/icons
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}];
|
}]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user