godot-rust / gdnative

Rust bindings for Godot 3
https://godot-rust.github.io
MIT License
3.61k stars 210 forks source link

Add Flake for NixOS #1069

Closed jaoleal closed 6 months ago

jaoleal commented 6 months ago

Edit bromeon: copied description from https://github.com/godot-rust/gdnative/issues/1068

Case

So, after spending 4 whole days to make the bindgen and the gdnative work on my NixOs i came with a flake that i want to share. i got fundamental help of my super NixOs-User @storopoli.

Flake

https://github.com/jaoleal/Uni9Jogo/commit/3dcc053b103f4418c6d1365df6e7251edd203c98

Its not perfect and theres some diferences of the official one in the book

Cons

Feel free to help improve it

Bromeon commented 6 months ago

Relevant book page: https://godot-rust.github.io/gdnative-book/recipes/nix-build-system.html

I'm not sure if the repo is the right place for this, especially now that we have it in two places (book + here).

Could you elaborate more concretely how the existing Flake caused problems or what this improves? You mentioned brief pros/cons, but a bit more details would be nice.

storopoli commented 6 months ago

Could you elaborate more concretely how the existing Flake caused problems or what this improves? You mentioned brief pros/cons, but a bit more details would be nice.

You don't have a Flake. You have a suggested Nix shell that uses the system nixpkg which is not reproducible. A flake is, since it adds a flake.lock file. By the way we are missing that here.

jaoleal commented 6 months ago

Could you elaborate more concretely how the existing Flake caused problems or what this improves? You mentioned brief pros/cons, but a bit more details would be nice.

Well, if you run a NixOs you can try the old one... iven cargo will have some problems because some out of date hardcoded deps, that is the point of the problem that i ran. The flake will do most of the work.

I'm not sure if the repo is the right place for this, especially now that we have it in two places (book + here).

I`ll commit some improves and organization of the flake.

EDIT: Sure, the root of the project isnt the best place for it, so i made the PR directly to the book.

Bromeon commented 6 months ago

You don't have a Flake. You have a suggested Nix shell that uses the system nixpkg which is not reproducible.

Ah, right. I was confused by this, which implied an existing Flake 🙂

Flake

Its not perfect and theres some diferences of the official one in the book


EDIT: Sure, the root of the project isnt the best place for it, so i made the PR directly to the book.

Thanks, also for the elaboration! I'll close this then, let's continue there.