# How to build raylib project using nix flake?

**URL:** <https://ziggit.dev/t/how-to-build-raylib-project-using-nix-flake/9664>\
**Category:** Help\
**Tags:** build-system\
**Created:** [April 16, 2025, 2:44pm UTC](https://ziggit.dev/t/how-to-build-raylib-project-using-nix-flake/9664 "2025-04-16T14:44:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jossephus](https://ziggit.dev/user_avatar/ziggit.dev/jossephus/32/4190_2.png) [@jossephus](https://ziggit.dev/u/jossephus)\
**Post date:** [April 16, 2025, 2:44pm UTC](https://ziggit.dev/t/how-to-build-raylib-project-using-nix-flake/9664/1 "2025-04-16T14:44:54Z")

</div>

Thanks for ur quick reply. I only get the error on first build and succesive builds do not complain at all. The reason why i asked was everytime i try to run it i am getting "  
./zig-out/bin/zigraylib: /lib/x86\_64-linux-gnu/libc.so.6: version `GLIBC\_2.38’ not found (required by ./zig-out/bin/zigraylib)" error which i havent found any solution of.

```zig
zigraylib main*​​​ via ❄️ impure (nix-shell-env)
❯ ./zig-out/bin/zigraylib
./zig-out/bin/zigraylib: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by ./zig-out/bin/zigraylib)

```

Incase if it anyone needs to check my flake file here it is. [zig raylib flakes · GitHub](https://gist.github.com/jossephus/0172e0d446de16cf540e42c9dbcf3665)

---

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [April 16, 2025, 4:01pm UTC](https://ziggit.dev/t/how-to-build-raylib-project-using-nix-flake/9664/2 "2025-04-16T16:01:16Z")

</div>

I have almost zero experience using nix, so I will just list a few topics that may or may not be related:

- [Zig2nix: nix flake for packaging, building and running Zig projects](https://ziggit.dev/t/zig2nix-nix-flake-for-packaging-building-and-running-zig-projects/2830)
- [Baby’s first Zig project (w/ Bonus Nix-Zig flake based dev shell)](https://ziggit.dev/t/baby-s-first-zig-project-w-bonus-nix-zig-flake-based-dev-shell/9371)
- [zon2nix - Convert the dependencies in `build.zig.zon` to a Nix expression](https://ziggit.dev/t/zon2nix-convert-the-dependencies-in-build-zig-zon-to-a-nix-expression/1422)

Hopefully someone with more experience using nix can help you.

---

<div class="post-metadata">

**Author:** ![sbrow](https://ziggit.dev/user_avatar/ziggit.dev/sbrow/32/4970_2.png) [@sbrow](https://ziggit.dev/u/sbrow)\
**Post date:** [April 17, 2025, 2:23am UTC](https://ziggit.dev/t/how-to-build-raylib-project-using-nix-flake/9664/3 "2025-04-17T02:23:18Z")

</div>

Your nix flake doesn’t have any reference to Zig or glibc, how are you building Zig? Your #app only runs g++.

I would use [nixhub.io](http://nixhub.io) to grab the flake url you need to get the specific version of glibc that raylib appears to be asking for

> **[glibc | How to install with Nix or Devbox](https://www.nixhub.io/packages/glibc)**
>
> Install any version of glibc via Nix or Devbox - package glibc: GNU C Library
