{ config, pkgs, lib, inputs, ... }: let ocPath = "/boot/EFI/OC"; liminePath = "/boot/EFI/limine"; ocPkg = pkgs.fetchzip { url = "https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.1/OpenCore-1.0.1-RELEASE.zip"; sha256 = "sha256-uKn0HlXQLDgZaYjRL3QcoqZ3iji0klz4pxYoLphP5rs="; stripRoot = false; }; ocResources = pkgs.fetchzip { url = "https://github.com/acidanthera/OcBinaryData/archive/refs/heads/master.zip"; sha256 = "sha256-B5CABp0Y2dAVuw7185suaUuryl3iII4QNBVBttivQ7Y="; }; in { system.activationScripts.opencoreConfig = { text = '' echo "--- Copland Bootloader ---" mkdir -p ${ocPath}/Drivers mkdir -p ${ocPath}/Resources mkdir -p ${liminePath} cp -f ${ocPkg}/X64/EFI/OC/Drivers/*.efi ${ocPath}/Drivers/ cp -rf ${ocResources}/Resources/* ${ocPath}/Resources/ if [ -f ${pkgs.limine}/share/limine/BOOTX64.EFI ]; then cp -f ${pkgs.limine}/share/limine/BOOTX64.EFI ${liminePath}/BOOTX64.EFI fi cat < ${ocPath}/config.plist Booter Quirks AvoidRuntimeDefrag EnableWriteUnprotector ProvideCustomSlide SetupVirtualMap Misc Debug DisplayDelay0 DisplayLevel2147483650 Target3 Boot PickerModeBuiltin PickerAttributes1 PollAppleHotKeys ShowPicker Timeout10 Entries NameLimine Enabled PathPciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,0,0)/HD(1,GPT,73ae5e9a-c31d-4787-9792-ee1843de3e9d,0x800,0x200000)/\EFI\limine\BOOTX64.EFI Security AllowSetDefault ScanPolicy0 VaultOptional UEFI ConnectDrivers Input KeySupport KeySupportModeAuto Output ProvideConsoleGop ResolutionMax TextRendererBuiltinGraphics Quirks ReleaseUsbOwnership Drivers OpenRuntime.efi OpenLinuxBoot.efi OpenUsbKbDxe.efi OpenCanopy.efi EOF ''; }; }