abouttreesummaryrefslogcommitdiff
path: root/flake.nix
blob: 50221679b388b30614206d8143829179eb428d0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
  description = "Zig project flake";

  inputs = {
    zig2nix.url = "github:Cloudef/zig2nix";
  };

  outputs = { zig2nix, ... }: let
    flake-utils = zig2nix.inputs.flake-utils;
  in (flake-utils.lib.eachDefaultSystem (system: let
      # Zig flake helper
      # Check the flake.nix in zig2nix project for more options:
      # <https://github.com/Cloudef/zig2nix/blob/master/flake.nix>
      env = zig2nix.outputs.zig-env.${system} {};
    in with builtins; with env.pkgs.lib; rec {
      apps.default = env.app [] "zig build run -- \"$@\"";
      packages.default = env.package {
        src = cleanSource ./.;

        nativeBuildInputs = with env.pkgs; [];
        buildInputs = with env.pkgs; [];

        zigPreferMusl = false;
      };
    }));
}