Skip to content

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.

@Arctis-Fireblight
Copy link
Contributor

Hi @theoparis ,
I am a relatively new maintainer here, and am going back through all of the old PRs.
I see there are a few PRs here related to Nix packaging. While I am somewhat familiar with what Nix is, this is not my area of expertise.
Would you mind explaining your intended use case with this to better help myself and the rest of the team better understand what the benefits of providing upstreamed package definitions?
We are looking to make a final decision regarding this trio of PRs shortly. ( #954 , #247 , #154 )

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.

4 participants