2022-12-21 21:18:03 +00:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2022-04-29 02:25:05 +00:00
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
boot.loader = lib.mkIf (config.physical && pkgs.stdenv.isLinux) {
|
2022-06-12 20:43:07 +00:00
|
|
|
grub = {
|
|
|
|
enable = true;
|
2022-04-29 02:25:05 +00:00
|
|
|
|
2022-06-12 20:43:07 +00:00
|
|
|
# Not sure what this does, but it involves the UEFI/BIOS
|
|
|
|
efiSupport = true;
|
|
|
|
|
|
|
|
# Check for other OSes and make them available
|
|
|
|
useOSProber = true;
|
|
|
|
|
2022-10-29 03:58:25 +00:00
|
|
|
# Attempt to display GRUB on widescreen monitor
|
|
|
|
gfxmodeEfi = "1920x1080";
|
|
|
|
|
2023-03-08 22:42:25 +00:00
|
|
|
# Limit the total number of configurations to rollback
|
|
|
|
configurationLimit = 25;
|
|
|
|
|
2022-06-12 20:43:07 +00:00
|
|
|
# Install GRUB onto the boot disk
|
|
|
|
# device = config.fileSystems."/boot".device;
|
|
|
|
|
|
|
|
# Don't install GRUB, required for UEFI?
|
|
|
|
device = "nodev";
|
2022-06-14 10:38:34 +00:00
|
|
|
|
|
|
|
# Display menu indefinitely if holding shift key
|
|
|
|
extraConfig = ''
|
|
|
|
if keystatus --shift ; then
|
|
|
|
set timeout=-1
|
|
|
|
else
|
|
|
|
set timeout=0
|
|
|
|
fi
|
|
|
|
'';
|
2022-06-12 20:43:07 +00:00
|
|
|
};
|
|
|
|
|
2022-06-14 10:38:34 +00:00
|
|
|
# Always display menu indefinitely; default is 5 seconds
|
|
|
|
# timeout = null;
|
|
|
|
|
2022-06-12 20:43:07 +00:00
|
|
|
# Allows GRUB to interact with the UEFI/BIOS I guess
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
};
|
2023-02-17 23:15:23 +00:00
|
|
|
|
|
|
|
# Allow reading from Windows drives
|
|
|
|
boot.supportedFilesystems =
|
|
|
|
lib.mkIf (config.physical && pkgs.stdenv.isLinux) [ "ntfs" ];
|
|
|
|
|
2023-02-22 01:28:43 +00:00
|
|
|
# Use latest released Linux kernel by default
|
|
|
|
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
|
|
|
|
|
2022-04-29 02:25:05 +00:00
|
|
|
}
|