NixOS 使用 systemd-boot 而不是 grub,尽管它在 nix 配置文件中被禁用

NixOS 使用 systemd-boot 而不是 grub,尽管它在 nix 配置文件中被禁用

我已经安装了 NixOS 19,由于我想与 Windows 10 双启动,所以我需要使用 grub。这是我的引导加载程序配置:

  # Boot loader
  boot.loader = {
    systemd-boot.enable = false;
    efi = {
      canTouchEfiVariables = true;
      efiSysMountPoint = "/boot";
    };
    grub = {
      devices = [ "nodev" ];
      enable = true;
      efiSupport = true;
      version = 2;
      useOSProber = true;
    };
  };

即使我已经禁用systemd-boot,它仍然显示systemd-boot并且不显示grub

重建结果

sudo nixos-rebuild --install-bootloader swich

building Nix...
building the system configuration...
updating GRUB 2 menu...
Found Windows Boot Manager on /dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi
installing the GRUB 2 EFI boot loader into /boot...
Installing for x86_64-efi platform.
modprobe: can't change directory to '/lib/modules': No such file or directory
Installation finished. No error reported.
activating the configuration...
setting up /etc...
reloading user units for sddm...
reloading user units for aryan...
setting up tmpfiles

/boot/EFI 树

tree/boot/EFI

/boot/EFI
├── BOOT
│   └── BOOTX64.EFI
├── Linux
├── nixos
│   ├── cp7c6zhwyipdd78r5d6ffm4p686bpyi3-initrd-linux-4.19.79-initrd.efi
│   ├── n3hx5p444cg1mnwqhicyha7z9d6f0h4h-linux-4.19.79-bzImage.efi
│   ├── p94zhzgyc1iccmp2jfr0nylk6bdr4zzf-initrd-linux-4.19.78-initrd.efi
│   └── s7zp6i6r73a0sri2fihmpnwbqrpsk8fs-linux-4.19.78-bzImage.efi
├── NixOS-boot
│   └── grubx64.efi
└── systemd
    └── systemd-bootx64.efi

5 directories, 7 files

答案1

我需要在 BIOS 设置中从 切换Linux-bootloader到。NixOS-bootloader

相关内容