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

Add NixOS Flake #247

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

theoparis
Copy link

@theoparis theoparis commented Oct 7, 2024

Based on #154, this PR adds a nix flake.
The changes I've made compared to #154 are:

  • Signed commits
  • Added a Nix derivation
  • Added support for other systems (e.g. riscv64) via nix-systems
  • Used nixfmt (nixfmt-rfc-style package) for formatting

To Do:

  • Fix building on Darwin
  • Add runtime dependencies so you can nix build .# && ./result/bin/redot

Darwin support is still WIP which is why I made this a draft. It seems like AppKit/AppKit.h is not being found despite it being present in buildInputs.
Additionally, I had to temporarily modify platform_methods.py to allow finding moltenVK in ${darwin.moltenvk}/lib/libMoltenVK.dylib. This could probably be improved with a proper lookup of the entire sdk directory instead of looking in lib or other hard coded paths 🤔

Edit: Hmm, AppKit.h is not in an AppKit/ directory an is instead just AppKit.h via something like /nix/store/0nh8rqwsdaj9pj6lw0nkggry8ykkpazg-apple-framework-AppKit-11.0.0/Library/Frameworks/AppKit.framework/Versions/C/Headers/AppKit.h.

@Spartan322
Copy link
Member

Is this still being worked on, and has this been proposed to Godot?

@Spartan322
Copy link
Member

Also does this close #154?

@MichaelFisher1997
Copy link

@Spartan322 I have my eye on this.
#154 is mine, this is an improvement on that (so probs close #154)
its gone a bit far past my knowledge of nix shells, but a few people in the community are asking for it.
ive spoken to a few people, we will be getting back to this, a few use it already to do local builds

@MichaelFisher1997
Copy link

Is this still being worked on, and has this been proposed to Godot?

yes, no

@Spartan322 Spartan322 changed the title Add nix flake Add NixOS Flake Oct 31, 2024
@theoparis theoparis force-pushed the theoparis/nix branch 2 times, most recently from bfafb16 to 59597d0 Compare December 5, 2024 07:38
Update the copy command in package.nix to match the output binary names.
- Added a mono build option with dotnet 9
- Added OpenGL and fixed runtime dependencies
- Migrated to nixpkgs master
@theoparis
Copy link
Author

An update on this PR:

  • I moved to nixpkgs master instead of flakehub, however if preferred I can switch to nixpkgs-unstable. Personally I think the master branch is still stable enough while receiving the latest updates from nixpkgs. Due to using flakes there is a lock file that pins a specific commit of nixpkgs.
  • I added Dotnet 9 to the package.nix file, along with a enableMono option that is currently untested. I think there are some post compilation steps that I haven't added yet for that to work. I'm also not sure if Redot supports Dotnet 9 yet.
  • I added runtimeDependencies with libGL so that OpenGL/EGL and the rest of the shared libraries can be found.

I recently installed NixOS via dual booting on my new macbook pro so I haven't really worked on Darwin support lately - I assume it's still broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants