NixOS on ARM/UEFI: Difference between revisions

imported>Mweinelt
imported>Mweinelt
Bootloader configuration: Use proper file template for nixos configuration
Line 77: Line 77:
Know if your ''Platform Firmware'''s UEFI implementation has writable EFI vars. This is not true for all UEFI implementations on ARM, but is something to be mindful about. If it does not, {{Nixos:option|boot.loader.efi.canTouchEfiVariables}} has to be set to '''<code>false</code>'''.
Know if your ''Platform Firmware'''s UEFI implementation has writable EFI vars. This is not true for all UEFI implementations on ARM, but is something to be mindful about. If it does not, {{Nixos:option|boot.loader.efi.canTouchEfiVariables}} has to be set to '''<code>false</code>'''.


<syntaxhighlight lang="nix">
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ /* configuration.nix */
{
   boot.loader.efi.canTouchEfiVariables = false;
   boot.loader.efi.canTouchEfiVariables = false;
}
}
</syntaxhighlight>
</nowiki>}}


{{tip|Just like on <tt>x86_64</tt> [[REFInd|rEFInd]] installed to the fallback location (<code>/EFI/BOOT/BOOTAA64.EFI</code>) may be helpful.}}
{{tip|Just like on <tt>x86_64</tt> [[REFInd|rEFInd]] installed to the fallback location (<code>/EFI/BOOT/BOOTAA64.EFI</code>) may be helpful.}}
Line 87: Line 87:
This sample uses GRUB2, but systemd-boot was also verified to work. Since EFI variables cannot be manipulated, using <code>efiInstallAsRemovable</code> handles installing GRUB2 to the default fallback location.
This sample uses GRUB2, but systemd-boot was also verified to work. Since EFI variables cannot be manipulated, using <code>efiInstallAsRemovable</code> handles installing GRUB2 to the default fallback location.


<syntaxhighlight lang="nix">
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ /* configuration.nix */
{
   boot.loader.grub.enable = true;
   boot.loader.grub.enable = true;
   boot.loader.grub.efiSupport = true;
   boot.loader.grub.efiSupport = true;
Line 94: Line 94:
   boot.loader.grub.device = "nodev";
   boot.loader.grub.device = "nodev";
}
}
</syntaxhighlight>
</nowiki>}}


=== General Tips ===
=== General Tips ===