{ lib, config, options, pkgs, ... }:
with lib;
let cfg = config.modules.system.boot.grub;
in {
options.modules.system.boot.grub = {
enable = mkEnableOption true;
};
config = mkIf cfg.enable {
boot.loader = {
systemd-boot.enable = false;
grub = {
# efiInstallAsRemovable = true;
enable = true;
useOSProber = true;
efiSupport = true;
fsIdentifier = "label";
devices = [ "nodev" ];
extraEntries = ''
menuentry "Reboot" {
reboot
}
menuentry "Poweroff" {
halt
'';
theme = pkgs.stdenv.mkDerivation {
pname = "distro-grub-themes";
version = "3.1";
src = pkgs.fetchFromGitHub {
owner = "AdisonCavani";
repo = "distro-grub-themes";
rev = "v3.1";
hash = "sha256-ZcoGbbOMDDwjLhsvs77C7G7vINQnprdfI37a9ccrmPs=";
installPhase = "cp -r customize/nixos $out";
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";