{ stdenv,
  zig_0_13,
  lib,
  callPackage,
  version ? "git",
  ...
}:
stdenv.mkDerivation {
  pname = "artificer";
  inherit version;
  src = lib.cleanSource ./.;

  nativeBuildInputs = [
    zig_0_13.hook
  ];

  preConfigure = ''
    mkdir -p .cache
    ln -s ${callPackage ./deps.nix { zig = zig_0_13; }} .cache/p
    zigBuildFlags="build-cli -Dtarget=x86_64-linux --release=fast --global-cache-dir $(pwd)/.cache"
  '';
}
