Zig-overlay#master as nix pkg

Recently on this 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.

I suggest doing your whole nixos install as a flake, then it’s simple Migrating a NixOS Install to Flakes ~ colinramsay.co.uk

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

Alternatively you can use flake-compat

1 Like