This flake contains a template to use for developing games with Ebitengine.
Create a new flake in the current directory using this template:
nix flake init -t github:shellhazard/nix-ebiten
Enter a development shell:
nix develop
Confirm it all works by running the example program:
# nixos
go run cmd/hello/main.go
# non-nixos
nix run --impure github:nix-community/nixGL -- go run cmd/hello/main.go
Use Nix to build an output derivation:
# nixos
nix build && ./result/build/hello
# non-nixos
nix build .#nixgl
nix run --impure github:nix-community/nixGL -- ./result/build/hello
If you're new to Nix, there's a few things may catch you off guard:
- If you're not using NixOS, you will need to use nixGL as a wrapper to run your binaries/derivations.
- Flakes are still experimental. If you haven't used them before, you'll need to enable flakes in your environment.
- When your dependencies change, the
vendorHash
in yourflake.nix
will need to be updated. The easiest way to do this is to set it to an empty string, then runnix build
and use the hash provided on error. For more information, see the relevant documentation in nixpkgs.