try to make grub settings a custom option

This commit is contained in:
smayzy 2025-07-04 15:49:11 +02:00
parent f149f12bf7
commit 95f71801e0
3 changed files with 21 additions and 8 deletions

View File

@ -9,8 +9,6 @@
../../modules/nix/virt.nix ../../modules/nix/virt.nix
]; ];
boot.loader.efi.canTouchEfiVariables = true;
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = { inherit inputs; };
users = { users = {

View File

@ -7,7 +7,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
boot.loader.grub.efiInstallAsRemovable = true; smayzy.grub-on-lap = true;
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = { inherit inputs; };

View File

@ -1,7 +1,22 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
{ {
boot.loader.systemd-boot.enable = false; options.smayzy.grub-on-lap.enable = mkOption {
boot.loader.grub.enable = true; type = types.bool;
boot.loader.grub.efiSupport = true; default = false;
boot.loader.grub.device = "nodev"; 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;
};
} }