nix-config/modules/nix/hardware/grub.nix
smayzy 924395d64e
All checks were successful
nixos config pipeline / show-flake (push) Successful in 19s
nixos config pipeline / deploy (push) Successful in 45s
try to fix for proxmox by disableing grub
2025-09-10 19:30:36 +02:00

33 lines
883 B
Nix

{ config, lib, ... }:
with lib;
{
options.smayzy.grub.disable = mkOption {
type = types.bool;
default = false;
description = "if don't need a cool bootloader";
};
options.smayzy.grub-on-lap.enable = mkOption {
type = types.bool;
default = false;
description = "make grub works on this piece of shit laptop that can't boot normally";
};
config = lib.mkMerge [
(lib.mkIf (!config.smayzy.grub.disable) {
boot.loader.systemd-boot.enable = false;
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.device = "nodev";
boot.loader.grub.efiInstallAsRemovable = config.smayzy.grub-on-lap.enable;
boot.loader.efi.canTouchEfiVariables = !config.smayzy.grub-on-lap.enable;
})
(lib.mkIf config.smayzy.grub.disable {
boot.loader.systemd-boot.enable = true;
})
];
}