Giter VIP home page Giter VIP logo

zig-overlay's Introduction

Nix Flake for Zig

This repository is a Nix flake packaging the Zig compiler. The flake mirrors the binaries built officially by Zig and does not build them from source.

This repository is meant to be consumed primarily as a flake but the default.nix can also be imported directly by non-flakes, too.

The flake outputs are documented in flake.nix but an overview:

  • Default package and "app" is the latest released version
  • packages.<version> for a tagged release
  • packages.master for the latest nightly release
  • packages.master-<date> for a nightly release
  • overlays.default is an overlay that adds zigpkgs to be the packages exposed by this flake
  • templates.compiler-dev to setup a development environment for Zig compiler development.

Usage

Flake

In your flake.nix file:

{
  inputs.zig.url = "github:mitchellh/zig-overlay";

  outputs = { self, zig, ... }: {
    ...
  };
}

In a shell:

# run the latest released version
$ nix run 'github:mitchellh/zig-overlay'
# open a shell with nightly version dated 2021-02-13 (oldest version available)
$ nix shell 'github:mitchellh/zig-overlay#master-2021-02-13'
# open a shell with latest nightly version
$ nix shell 'github:mitchellh/zig-overlay#master'

Compiler Development

This flake outputs a template that makes it easy to work on the Zig compiler itself. If you're looking to contribute to the Zig compiler, here are the easy steps to setup a working development environment:

# clone zig and go into that directory
$ git clone https://github.com/ziglang/zig.git
$ cd zig
# setup the template
$ nix flake init -t 'github:mitchellh/zig-overlay#compiler-dev'
# Two options:
# (1) start a shell, this forces bash
$ nix develop
# (2) If you have direnv installed, you can start the shell environment
# in your active shell (fish, zsh, etc.):
$ direnv allow

FAQ

Why is a Nightly Missing?

There are two possible reasons:

  1. The Zig download JSON that is used to generate this overlay only shows the latest master release. It doesn't keep track of historical releases. If this overlay wasn't running or didn't exist at the time of a release, we could miss a day. This is why historical dates beyond a certain point don't exist; they predate this overlay (or original overlays this derives from).

  2. The official Zig CI only generates a master release if the CI runs full green. During certain periods of development, a full day may go by where the master branch of the Zig compiler is broken. In this scenario, a master build (aka "nightly") is not built or released at all.

Thanks

The sources.json file was originally from another Zig overlay repository hosted by the username arqv. This user and repository was deleted at some point, so I started a new flake based on the same sources.json format they used so I could inherit the history. Thank you for compiling nightly release information since 2021!

zig-overlay's People

Contributors

mitchellh avatar dependabot[bot] avatar yamashitax avatar davidgm94 avatar dezren39 avatar erikarvstedt avatar zidhuss avatar jakeisnt avatar jowi-dev avatar luexa avatar omaraaa avatar radvendii avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.