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 nix flake + package definitions for editor & export templates #954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Naxdy
Copy link

@Naxdy Naxdy commented Feb 4, 2025

Description

This PR adds a Nix package definition for the Redot editor, as well as the export templates for linuxbsd and windows.

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:

nix build github:Naxdy/redot-engine#redot

Then run ./result/bin/redot4 to run the editor. For the export templates, you can run the following:

# all export templates
nix build github:Naxdy/redot-engine#export-templates

# specific export template (see `nix flake show github:Naxdy/redot-engine` for a comprehensive list)
nix build github:Naxdy/redot-engine#export-templates-linux-release

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 with direnv.

The .gitignore file has been updated to exclude Nix-specific directories (outputs & direnv cache).

Caveats

  • MacOS export templates are not packaged, since I don't have a machine to test with. I also don't know if cross-compilation of the Windows export templates will function on Darwin with the derivations provided (I'd assume not?)
  • The Redot editor will be built without Mono support, since enabling it would require tracking a separate lockfile for all .NET packages (example: https://github.com/NixOS/nixpkgs/blob/6d5b297bc68f021d5fe9d43a3d1ba35a3b6d0663/pkgs/by-name/go/godot_4/deps.json ), which is a burden I did not want to push upon Redot maintainers. If desired, I (or someone else) can add in Mono support after the fact though.

Closes #247
Closes #154

@Spartan322 Spartan322 changed the title add nix flake + package definitions for editor & export templates Add nix flake + package definitions for editor & export templates Feb 4, 2025
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.

2 participants