better boot

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-06-09 20:57:24 +02:00
parent b5f04085ba
commit 28be563a54

View File

@@ -1,4 +1,4 @@
{ config, pkgs, host, inputs, ... }: { config, pkgs, lib, host, inputs, ... }:
let let
grub-theme-ascii-diana = (pkgs.fetchFromGitea { grub-theme-ascii-diana = (pkgs.fetchFromGitea {
domain = "git.nx2.site"; domain = "git.nx2.site";
@@ -12,43 +12,57 @@
imports = if host == "NxNORTH" then [ imports = if host == "NxNORTH" then [
inputs.lanzaboote.nixosModules.lanzaboote inputs.lanzaboote.nixosModules.lanzaboote
] else []; ] else [];
config = if host == "NxNORTH" then {
# I have to boot with secureboot becasue of the chinese spyware called Vanguard
environment.systemPackages = with pkgs; [ sbctl ];
boot = {
lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
loader.systemd-boot.enable = false; # let lanzaboote install systemd-boot
config = if (host == "NxXPS" || host == "NxACE") then { kernelPackages = pkgs.linuxPackages_latest;
boot.loader.efi.canTouchEfiVariables = true; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
};
} else if host == "NxXPS" then {
boot.loader.grub = { boot.loader.grub = {
enable = true; enable = true;
configurationLimit = 30; configurationLimit = 30;
device = "nodev"; device = "nodev";
# useOSProber = true; # useOSProber = true;
efiSupport = true; efiSupport = true;
#theme = grub-theme-ascii-diana; theme = grub-theme-ascii-diana;
#font = "${grub-theme-ascii-diana}/unicode.pf2"; font = "${grub-theme-ascii-diana}/unicode.pf2";
fontSize = 50; fontSize = 50;
# splashImage = null; # splashImage = null;
extraEntries = if host == "NxXPS" then '' kernelPackages = pkgs.linuxPackages_latest;
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
efi.canTouchEfiVariables = true;
extraEntries = ''
menuentry 'Windows 11' --class windows --class os $menuentry_id_option 'osprober-efi-0A97-7A2D' { menuentry 'Windows 11' --class windows --class os $menuentry_id_option 'osprober-efi-0A97-7A2D' {
insmod part_gpt insmod part_gpt
insmod fat insmod fat
search --no-floppy --fs-uuid --set=root 0A97-7A2D search --no-floppy --fs-uuid --set=root 0A97-7A2D
chainloader /EFI/Microsoft/Boot/bootmgfw.efi chainloader /EFI/Microsoft/Boot/bootmgfw.efi
} }
'' else ''''; '';
}; };
} else { } else { # NxACE
# I have to boot with secureboot becasue of the chinese spyware called Vanguard kernelPackages = pkgs.linuxPackages_latest;
environment.systemPackages = with pkgs; [ extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
sbctl boot.loader.grub = {
];
boot = {
lanzaboote = {
enable = true; enable = true;
pkiBundle = "/etc/secureboot"; configurationLimit = 30;
}; device = "nodev";
# useOSProber = true;
# let lanzaboote install systemd-boot efiSupport = true;
loader.systemd-boot.enable = false; fontSize = 50;
efi.canTouchEfiVariables = true;
splashImage = null;
}; };
}; };
} }