Anut-py / h-raylib

Haskell bindings for raylib
https://hackage.haskell.org/package/h-raylib
Apache License 2.0
84 stars 14 forks source link

Add flake.nix #27

Closed MagicRB closed 1 year ago

MagicRB commented 1 year ago

Adds flake.nix, allows for development on NixOS

MagicRB commented 1 year ago

I'm still testing this, please hold off on merging

MagicRB commented 1 year ago

This seems to work

futu2 commented 1 year ago

I don't understand why it costs that lots of code. How did the pkgs.haskellPackages.h-raylib works? It seems work well before ( broken in unstable now). I am not very familiar with nix, but why system default drv works well, is anybody make a patch to it? See https://github.com/NixOS/nixpkgs/issues/197407

MagicRB commented 1 year ago

the problem is that h-raylib brings its own raylib and glfw. Which works well on other distros but is very un-NixOS-sy imo. Removing that simplifies packaging a lot.

Anut-py commented 1 year ago

I will have to update the git revision for raylib in flake.nix every time I pull the raylib source right?

MagicRB commented 1 year ago

Well if you keep tracking master, then probably. raylib in nixpkgs is too old and tracks stable releases.

MagicRB commented 1 year ago

there is no easy way to include a submodule. Nix doesn't do submodules.

futu2 commented 1 year ago

there is no easy way to include a submodule. Nix doesn't do submodules.

Can nix flake fetch a raylib repo right in the ./. folder? My simple callCabal2nix flake scripts run nix build successfully if delete git info by running mv .git .git.bk

MagicRB commented 1 year ago

yeah deleting .git is a horrible hack, nix just does not work with submodules.