# Zig-overlay#master as nix pkg

**URL:** <https://ziggit.dev/t/zig-overlay-master-as-nix-pkg/2855>\
**Category:** Help\
**Tags:** compiler\
**Created:** [January 14, 2024, 11:11am UTC](https://ziggit.dev/t/zig-overlay-master-as-nix-pkg/2855 "2024-01-14T11:11:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrilguiz](https://ziggit.dev/user_avatar/ziggit.dev/cyrilguiz/32/1851_2.png) [@cyrilguiz](https://ziggit.dev/u/cyrilguiz)\
**Post date:** [January 14, 2024, 11:11am UTC](https://ziggit.dev/t/zig-overlay-master-as-nix-pkg/2855/1 "2024-01-14T11:11:42Z")

</div>

Recently on [this](https://ziggit.dev/t/zig-master-on-nixos/2801/2) post I inquired about using the latest Zig) master on nixos. I recently migrated to it and was confused on how to install Zig on nixos. I found the solution to the question which I asked initially but now I want to know if there is a way to use the flake as a package in nix. I want to know because I don’t like the fact that I have to get into nix-shell to run my zig program. At the time of writing the Zig master is 0.12.0-dev.2158+4f2009de1 and my nixos version is 24.05. Also I want the same information for zls.

---

<div class="post-metadata">

**Author:** ![Cloudef](https://ziggit.dev/user_avatar/ziggit.dev/cloudef/32/1370_2.png) [@Cloudef](https://ziggit.dev/u/Cloudef)\
**Post date:** [January 14, 2024, 11:23am UTC](https://ziggit.dev/t/zig-overlay-master-as-nix-pkg/2855/2 "2024-01-14T11:23:35Z")

</div>

I suggest doing your whole nixos install as a flake, then it’s simple [Migrating a NixOS Install to Flakes ~ colinramsay.co.uk](https://colinramsay.co.uk/2021/10/19/migrating-a-nixos-install-to-flakes.html)

I don’t personally put zig into my system packages, but I do pass latest zig to zls here

> <https://github.com/Cloudef/nixos-flake/blob/master/modules/neovim.nix#L7>

Alternatively you can use flake-compat  
[https://nixos.wiki/wiki/Flakes#Using\_flakes\_with\_stable\_Nix](https://nixos.wiki/wiki/Flakes#Using_flakes_with_stable_Nix)
