Skip to content

Development with nix

Vesim edited this page Apr 27, 2021 · 26 revisions

Here is a sample shell.nix for building/developing zig.

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  hardeningDisable = [ "all" ];
  buildInputs = with pkgs; [
    cmake
    gdb
    clang_12
    llvmPackages_12.clang-unwrapped
    llvm_12
    lld_12
    ninja
    qemu
  ];
}

The hardeningDisable part is crucial otherwise you will get compile errors.