tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
838 stars 80 forks source link

Remove IFD in kernel build #70

Closed QuentinI closed 1 year ago

QuentinI commented 1 year ago

Resolves #51

tpwrules commented 1 year ago

Thank you very much for figuring this out. Is it still technically doing IFD though if there are kernelPatches?

QuentinI commented 1 year ago

Is it still technically doing IFD though if there are kernelPatches?

It's not importing a Nix expr, so as far as I understand it it's more like a "Read From Derivation", which shouldn't be problematic

tpwrules commented 1 year ago

I think it's still problematic because builds have to run before the evaluation can occur. I think the magnitude is much less than before but there is still IFD happening.

anna328p commented 1 year ago

https://github.com/tpwrules/nixos-apple-silicon/pull/70/files#diff-6db5403c64ac81d76097a9d10fbf02809552a396970b1a594d422515de2f0140R37-R43

It's possible to get rid of the IFD by getting rid of writeFile here and concatenating the config with the patches in Nix code. Instead of readFile (writeFile foo), we just read foo, which isn't the output of a derivation.

I can PR this if needed.