❄️ Dotfiles for our NixOS system configuration.
1{ lib, config, ... }:
2
3{
4 options.settings.bootloader.grub = {
5 enable = lib.mkEnableOption "Enable GRUB bootloader (legacy/MBR)";
6 device = lib.mkOption {
7 type = lib.types.str;
8 default = "/dev/sda";
9 description = "Device to install GRUB to (for MBR/legacy boot)";
10 };
11 };
12
13 config = lib.mkIf (config.settings.bootloader.enable && config.settings.bootloader.grub.enable) {
14 boot.loader = {
15 grub = {
16 enable = true;
17 device = config.settings.bootloader.grub.device;
18 };
19 systemd-boot.enable = lib.mkForce false;
20 };
21 };
22}