{ config, lib, pkgs, ... }: with lib; { 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 = { 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 = mkIf config.smayzy.grub-on-lap.enable true; boot.loader.efi.canTouchEfiVariables = mkIf (!config.smayzy.grub-on-lap.enable) true; }; }