-
Notifications
You must be signed in to change notification settings - Fork 257
Add nix flake + package definitions for editor & export templates #954
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
base: master
Are you sure you want to change the base?
Conversation
5e9840d
to
df28e3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested building on my NixOS 25.05 system, fails with same issue as NixOS/nixpkgs#399818 but including the fix from NixOS/nixpkgs#400347 it builds nicely!
package.nix
Outdated
# | ||
# See also 'methods.py' in the Redot repo and 'build' in | ||
# https://docs.redotengine.org/en/stable/classes/class_engine.html#class-engine-method-get-version-info | ||
BUILD_NAME = "nixpkgs"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be removed or set to "nix_flake" or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set it to flake
. Removing would cause it to be custom_build
which I don't think is descriptive enough.
This PR doesn't include nix-systems/default, and hard codes supported systems... meaning riscv64-linux systems can't build this flake. Additionally there seems to be a typo for aarch64-darwin. |
@Cammymoop @theoparis Good points from both of you. I switched to an overlay-based approach. So maintainers can still manually curate a list of supported systems, but downstream users can (attempt to) build regardless of their architecture, and this way doesn't require an extra input. Also changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built windows and linux export templates as well as the editor build, looks good.
Hi @Naxdy, |
Hi @Arctis-Fireblight , thanks for the inquiry. I will only comment on my PR here, without comparing to the others. Please feel free to ask follow-up questions if you feel I'm being unclear. This PR is doing a couple things:
Note that "Nix" does not mean "NixOS", as Nix the package manager is completely distro-agnostic and can even be installed without any root privileges. It isn't even Linux specific, as a macOS version exists as well (Windows does require WSL though). As you might be able to gather, building Redot this way would also be a prime candidate for CI, but only if there's interest from the maintainer side of course. There's also the option to cache built packages using a solution like Cachix, which we actually use extensively at my company, and even make the binary cache public, so other Nix users don't even have to build the packages locally if they don't change anything. Nix also supports running unit / E2E tests as part of the build process, and actually does so out of the box when building Redot. If you're worried about a potential future maintainer burden, I'd be happy to jump on the project as well, though I would strictly limit myself to maintaining the Nix builds and, if desired, CI. I should also add that, while I am a package maintainer for Let me know if you have any further questions! |
Description
This PR adds a Nix package definition for the Redot editor, as well as the export templates for
linuxbsd
andwindows
.Once merged, it will be possible to build / install the editor and export templates locally using the Nix package manager. The Nix package manager itself is distro-agnostic, and can be downloaded for Linux as well as MacOS here: https://nixos.org/
To test this PR, it is possible to run the following command to build the editor locally using Nix:
Then run
./result/bin/redot4
to run the editor. For the export templates, you can run the following:The export templates will be symlinked under
./result/share/redot/export_templates/[engine-version]
Note
The nix build script retrieves the version info from
version.py
and assumes that variables and values are delimited by " = " (space-equalsign-space).Dev Shell
A rudimentary dev shell that provides all packages used by the nix derivation is also provided via
devShells.default
, including an.envrc
file for use withdirenv
.The
.gitignore
file has been updated to exclude Nix-specific directories (outputs & direnv cache).Caveats
Closes #247
Closes #154