From 5e45f5e1dea22d0686b467e7eda6d24f1fd4e3a2 Mon Sep 17 00:00:00 2001 From: Yappaholic Date: Wed, 26 Jun 2024 02:13:55 +0300 Subject: [PATCH 1/2] Added tutorial to install overlay --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11a67ba..a4e2ef8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ In your `flake.nix` file: }; } ``` - In a shell: ```sh @@ -44,7 +43,35 @@ $ nix shell 'github:mitchellh/zig-overlay#master-2021-02-13' # open a shell with latest nightly version $ nix shell 'github:mitchellh/zig-overlay#master' ``` +### Adding zig as a package +To access zig as a package: + In your `flake.nix` file: + +```nix +{ + inputs.zig.url = "github:mitchellh/zig-overlay"; + + outputs = { self, zig, ... }: { + ... + modules = [ + {nixpkgs.overlays = [zig.overlays.default];} + ... + ... + ]; + }; +} +``` +In your `configuration.nix` file : + +```nix + {pkgs,inputs, ...}: { + ... + environment.systemPackages = [ + pkgs.zigpkgs.master # or /master-/ + ] +} +``` ### Compiler Development This flake outputs a template that makes it easy to work on the Zig From f7497b958ae56374228f27403559e8dc6ad2e4b7 Mon Sep 17 00:00:00 2001 From: Yappaholic Date: Wed, 26 Jun 2024 02:15:26 +0300 Subject: [PATCH 2/2] Fixed typo --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4e2ef8..59126d3 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,8 @@ $ nix shell 'github:mitchellh/zig-overlay#master' ### Adding zig as a package To access zig as a package: - In your `flake.nix` file: + +In your `flake.nix` file: ```nix {