tpwrules / nixos-apple-silicon

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

Flake-based configurations must be built in impure mode when using experimental GPU support #48

Closed tpwrules closed 1 year ago

tpwrules commented 1 year ago

Flake-based configurations must be built in impure mode when using experimental GPU support. This is due to the usage of system.replaceRuntimeDependencies to use Asahi's version of Mesa so that all programs work correctly.

I am exploring whether the recent Mesa upgrade in nixpkgs is enough to resolve the underlying issue and allow the removal of this replacement. If not, an extra configuration option will be added to properly overlay Asahi Mesa, though a large number of rebuilds will be required for flake users.

In the meantime, the best option is to use the --impure flag of nixos-rebuild if experimental GPU support is desired.

tpwrules commented 1 year ago

This might be fixable in Nix or nixpkgs if someone else has the time to investigate: https://github.com/NixOS/nixpkgs/issues/199162

oati commented 1 year ago

It might be worth having a module option that toggles the replaceRuntimeDependencies while this issue is present.

Also, there might be some way to avoid mass rebuilds using content-addressed derivations (https://nixos.wiki/wiki/Ca-derivations), but I don't know enough about how IA and CA derivations interact, or how remote caching works in these cases to be sure.

oati commented 1 year ago

Well, I guess I could always set hardware.opengl.package = pkgs.mesa-asahi-edge; myself (with the overlay in #47), if I want to use mesa without runtime overrides.

tpwrules commented 1 year ago

I did confirm that the next Mesa will not fix this issue and an overlay or replacement is still needed.

I will add an option to change which is used in the next release, which will happen once the nixpkgs channels advance. I hope this is not too big an inconvenience.

tpwrules commented 1 year ago

This can be worked around as of the latest release.