An open API service indexing awesome lists of open source software.

https://github.com/daddye/zig-overlay

Nix flake for Zig binaries
https://github.com/daddye/zig-overlay

Last synced: 5 months ago
JSON representation

Nix flake for Zig binaries

Awesome Lists containing this project

README

          

#+TITLE: Nix flake for Zig

** Description
In this repository lives a Nix flake packaging the *Zig* compiler binaries using the [[https://ziglang.com/download/index.json][data]] provided by the Zig team.

*** Provided utilities
- /Nightly/ versions updated daily (=.master.=), starting from version =0.8.0-dev.1140+9270aae07= dated 2021-02-13, and latest master (=.master.latest=) for the sake of convenience.
- Release versions.

*** Usage
**** Without flake support?
Import in your project as you would normally (=pkgs.fetchFromGitHub= or =builtins.fetchgit=), with (/hopefully/) no tinkering needed! The =default.nix= exposes a =pkgs= argument for possible pinning of the Nixpkgs repository, and a =system= argument which defaults to =builtins.currentSystem=.

To make it visible in your system configuration:
#+begin_src nix
# It is a good idea to use an exact commit in place of 'main' here.
let zigf = fetchTarball "https://github.com/arqv/zig-overlay/archive/main.tar.gz" in
# If you're using home-manager
home.packages = [ zigf.master.latest ]; # or any available version
# If you're using NixOS
users.user..packages = [ zigf.master.latest ]; # or any available version
# ...the rest of your configuration
#+end_src

**** With flake support?
In your =flake.nix= file:
#+begin_src nix
{
inputs.zig.url = "github:arqv/zig-overlay";
outputs = { self, zig, ... }: {
...
};
}
#+end_src
In a shell:
#+begin_src sh
# run the latest version (0.7.1)
$ nix run 'github:arqv/zig-overlay'
# open a shell with master version dated 2021-02-13 (oldest version available)
$ nix shell 'github:arqv/zig-overlay#master."2021-02-13"'
# open a shell with latest master version
$ nix shell 'github:arqv/zig-overlay#master.latest'
#+end_src

** For contributors
The =update= script manages updating the information in =sources.json=. The only dependency is Nix, and it's written internally in Ruby.