Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/nix flake mac #102

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

xav-ie
Copy link

@xav-ie xav-ie commented Dec 19, 2024

Hello, the nix flake was not working on my mac. After these fixes, it works.

I noticed the flake.nix was not formatted. I let my autoformatter do it. I am using the official nix formatter https://github.com/NixOS/nixfmt. I would be happy to alter the nix file to bundle the preferred formatter if you have one. This way, people will not be confused about how to format.

I am not a nix expert, but I do recommend trying out denvenv.nix (https://devenv.sh) instead of using a flake.nix. It works with direnv, it has better caching (basically a flake.nix needs to take in the whole repo, binaries and all to set up.. blegh), it is easier to set up and understand. Respectable if you want to keep the status quo, but devenv is awesome! :)

  • fix(flake): refactor for mac support
  • chore(flake.lock): update

The flake was including packages that are not necessary and
do not work on Mac.
required for compiling bevy
@xav-ie xav-ie marked this pull request as ready for review December 19, 2024 05:04
Copy link
Owner

@alphastrata alphastrata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive me as I'm viewing this on phone, I am no longer a nix user so testing this will be difficult.

What exactly has changed pkg wise? It looks like predominantly formatting... [Again on phone so apologies if I've missed something. Obvious], if we're missing things that are egregious we should point a pr at the bevy repo as this flake is essentially a copy paste of their official one..

@xav-ie
Copy link
Author

xav-ie commented Dec 21, 2024

I see. I can try and minimize the formatting changes, but the flake includes a lot of packages that just don't work on aarch64-darwin machines. Trying to use the flake will not work on darwin because packages like systemd are included unconditionally. I just add conditions to check if linux or not.

I can look into improving the bevy flake instead. Feel free to close, it should at least be searchable now if other users are trying to just get started.

If you know what formatter you use, I can try and use that to minimize the changes.

edit: ... it seems like bevy may have also dropped the flake. I could not find it. :/

@alphastrata
Copy link
Owner

I'm not using nix these days [don't have the time].

But I do like it, and would like to see it supported, both in bevy and here!

Maybe we can rename it to flake.nix.example and then update the readme so we point nix users to it?

I'm happy to merge it and do that later, but as I'm on the phone [holiday no rig here ..] it'd be speedier if you can update, on the assumption you're happy to do so.

I never tested the nix stuff on mac when I had one, and even then I had an old-school Intel mac for which it's likely a lot of the packages are different again...

@alphastrata alphastrata added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants