This commit is contained in:
elwrcl committed 2026-04-14 23:52:34 +03:00
1 parent 80953bc329
commit 96d3a85dfb
1 file changed
+40 -45
+40 -45
View File
@@ -3,26 +3,46 @@
let let
ocPath = "/boot/EFI/OC"; ocPath = "/boot/EFI/OC";
liminePath = "/boot/EFI/limine"; liminePath = "/boot/EFI/limine";
ocDrivers = "${inputs.oceanix.packages.${pkgs.system}.opencore}/EFI/OC/Drivers";
# OpenCore Sürücüleri için (GitHub'dan otomatik çekilir)
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;
};
# OpenCore İkonlar ve Fontlar (Saat/Görsellik için)
ocResources = pkgs.fetchzip {
url = "https://github.com/acidanthera/OcBinaryData/archive/refs/heads/master.zip";
sha256 = "sha256-RInN96Ie/lXvF72Ere8oGfW4Uu8W1Y6i9zD37nN+1+c=";
};
in in
{ {
system.activationScripts.opencoreConfig = { system.activationScripts.opencoreConfig = {
text = '' text = ''
CUR_KERNEL=$(ls /boot/EFI/nixos/*-bzImage.efi | head -n 1 | xargs basename)
CUR_INITRD=$(ls /boot/EFI/nixos/*-initrd.efi | head -n 1 | xargs basename)
echo "--- Copland Bootloader ---" echo "--- Copland Bootloader ---"
mkdir -p ${ocPath}/Drivers mkdir -p ${ocPath}/Drivers
mkdir -p ${ocPath}/Resources
mkdir -p ${liminePath} mkdir -p ${liminePath}
cp -f ${ocPkg}/X64/EFI/OC/Drivers/*.efi ${ocPath}/Drivers/
# EKSİK SÜRÜCÜLERİ BURADA MANUEL KOPYALIYORUZ cp -rf ${ocResources}/Resources/* ${ocPath}/Resources/
cp -f ${ocDrivers}/OpenCanopy.efi ${ocPath}/Drivers/
cp -f ${ocDrivers}/OpenUsbKbDxe.efi ${ocPath}/Drivers/
# Bunlar sende vardı ama garanti olsun diye üzerinden geçiyoruz
cp -f ${ocDrivers}/OpenRuntime.efi ${ocPath}/Drivers/
cp -f ${ocDrivers}/OpenLinuxBoot.efi ${ocPath}/Drivers/
if [ -f ${pkgs.limine}/share/limine/BOOTX64.EFI ]; then if [ -f ${pkgs.limine}/share/limine/BOOTX64.EFI ]; then
cp -f ${pkgs.limine}/share/limine/BOOTX64.EFI ${liminePath}/BOOTX64.EFI cp -f ${pkgs.limine}/share/limine/BOOTX64.EFI ${liminePath}/BOOTX64.EFI
fi fi
cat <<EOF > ${liminePath}/limine.conf
TIMEOUT=5
GRAPHICS=yes
INTERFACE_RESOLUTION=1366x768
:NixOS (CachyOS)
PROTOCOL=linux
KERNEL_PATH=boot:///EFI/nixos/j2rky4bwgy6s1d5j15pvz4yiprhm96j2-linux-cachyos-latest-lto-x86_64-v2-6.19.11-bzImage.efi
MODULE_PATH=boot:///EFI/nixos/bfy4s8c3lhhdqqpw0ys5gik4vs6hyjlz-initrd-linux-cachyos-latest-lto-x86_64-v2-6.19.11-initrd.efi
CMDLINE=preempt=full i915.enable_fbc=1 mitigations=off "i915.enable_fbc=1" "usbcore.autosuspend=-1" "transparent_hugepage=always"
EOF
cat <<EOF > ${ocPath}/config.plist cat <<EOF > ${ocPath}/config.plist
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@@ -35,20 +55,8 @@ in
<dict> <dict>
<key>AvoidRuntimeDefrag</key><true/> <key>AvoidRuntimeDefrag</key><true/>
<key>EnableWriteUnprotector</key><true/> <key>EnableWriteUnprotector</key><true/>
<key>SetupVirtualMap</key><true/>
<key>ProvideCustomSlide</key><true/> <key>ProvideCustomSlide</key><true/>
</dict> <key>SetupVirtualMap</key><true/>
</dict>
<key>DeviceProperties</key>
<dict>
<key>Add</key>
<dict>
<key>PciRoot(0x0)/Pci(0x2,0x0)</key>
<dict>
<key>AAPL,ig-platform-id</key><data>AwBmAQ==</data>
<key>framebuffer-patch-enable</key><data>AQAAAA==</data>
</dict>
</dict> </dict>
</dict> </dict>
@@ -58,6 +66,7 @@ in
<dict> <dict>
<key>PickerMode</key><string>External</string> <key>PickerMode</key><string>External</string>
<key>PickerAttributes</key><integer>17</integer> <key>PickerAttributes</key><integer>17</integer>
<key>Resolution</key><string>1366x768</string>
<key>Timeout</key><integer>5</integer> <key>Timeout</key><integer>5</integer>
</dict> </dict>
<key>Entries</key> <key>Entries</key>
@@ -76,27 +85,6 @@ in
</dict> </dict>
</dict> </dict>
<key>NVRAM</key>
<dict>
<key>Add</key>
<dict>
<key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key>
<dict>
<key>boot-args</key>
<string>-v amfi_get_out_of_my_way=1 -no_compat_check ipc_control_port_options=0</string>
</dict>
</dict>
</dict>
<key>PlatformInfo</key>
<dict>
<key>Generic</key>
<dict>
<key>SystemProductName</key><string>MacBookPro16,1</string>
<key>AdviseFeatures</key><true/>
</dict>
</dict>
<key>UEFI</key> <key>UEFI</key>
<dict> <dict>
<key>Input</key> <key>Input</key>
@@ -105,6 +93,9 @@ in
<key>KeySupportMode</key><string>Auto</string> <key>KeySupportMode</key><string>Auto</string>
<key>ReleaseUsbOwnership</key><true/> <key>ReleaseUsbOwnership</key><true/>
</dict> </dict>
<key>Quirks</key>
<dict>
<key>ProvideConsoleGop</key><true/> </dict>
<key>Drivers</key> <key>Drivers</key>
<array> <array>
<string>OpenRuntime.efi</string> <string>OpenRuntime.efi</string>
@@ -113,9 +104,13 @@ in
<string>OpenUsbKbDxe.efi</string> <string>OpenUsbKbDxe.efi</string>
</array> </array>
</dict> </dict>
</dict> </dict>
</plist> </plist>
EOF EOF
if ! ${pkgs.efibootmgr}/bin/efibootmgr | grep -q "OpenCore_Copland"; then
${pkgs.efibootmgr}/bin/efibootmgr -c -d /dev/sda -p 1 -L "OpenCore_Copland" -l "\EFI\OC\OpenCore.efi"
fi
''; '';
}; };
} }