From a11e50c087c4527443f4ae64d0b943e783b2b9fc Mon Sep 17 00:00:00 2001 From: Muki Kiboigo Date: Tue, 2 Sep 2025 08:58:31 -0700 Subject: [PATCH 1/2] nix flake for zig 0.15.1 --- flake.lock | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++-- flake.nix | 21 ++++++++- 2 files changed, 142 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 1c140996..497b274e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -18,13 +34,52 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "zlsPkg", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1754919767, - "narHash": "sha256-bc9tjR2ymbmbtYlnOcksjI7tQtDDEEJFGm41t0msXsg=", + "lastModified": 1756822655, + "narHash": "sha256-xQAk8xLy7srAkR5NMZFsQFioL02iTHuuEIs3ohGpgdk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8c0c41355297485b39d6f6a6d722c8cdfe0257df", + "rev": "4bdac60bfe32c41103ae500ddf894c258291dd61", "type": "github" }, "original": { @@ -37,7 +92,9 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "zigPkgs": "zigPkgs", + "zlsPkg": "zlsPkg" } }, "systems": { @@ -54,6 +111,68 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "zigPkgs": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756555914, + "narHash": "sha256-7yoSPIVEuL+3Wzf6e7NHuW3zmruHizRrYhGerjRHTLI=", + "owner": "mitchellh", + "repo": "zig-overlay", + "rev": "d0df3a2fd0f11134409d6d5ea0e510e5e477f7d6", + "type": "github" + }, + "original": { + "owner": "mitchellh", + "repo": "zig-overlay", + "type": "github" + } + }, + "zlsPkg": { + "inputs": { + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "zig-overlay": [ + "zigPkgs" + ] + }, + "locked": { + "lastModified": 1756048867, + "narHash": "sha256-GFzSHUljcxy7sM1PaabbkQUdUnLwpherekPWJFxXtnk=", + "owner": "zigtools", + "repo": "zls", + "rev": "ce6c8f02c78e622421cfc2405c67c5222819ec03", + "type": "github" + }, + "original": { + "owner": "zigtools", + "ref": "0.15.0", + "repo": "zls", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index d902ef89..971f0f44 100644 --- a/flake.nix +++ b/flake.nix @@ -3,20 +3,37 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/release-25.05"; + + zigPkgs.url = "github:mitchellh/zig-overlay"; + zigPkgs.inputs.nixpkgs.follows = "nixpkgs"; + + zlsPkg.url = "github:zigtools/zls/0.15.0"; + zlsPkg.inputs.zig-overlay.follows = "zigPkgs"; + zlsPkg.inputs.nixpkgs.follows = "nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; }; outputs = { nixpkgs, + zigPkgs, + zlsPkg, flake-utils, ... }: flake-utils.lib.eachDefaultSystem ( system: let + overlays = [ + (final: prev: { + zigpkgs = zigPkgs.packages.${prev.system}; + zls = zlsPkg.packages.${prev.system}.default; + }) + ]; + pkgs = import nixpkgs { - inherit system; + inherit system overlays; }; # We need crtbeginS.o for building. @@ -32,7 +49,7 @@ targetPkgs = pkgs: with pkgs; [ # Build Tools - zig + zigpkgs."0.15.1" zls python3 pkg-config From 5cc5f45ef3f24f50f5b15ee6f1d9a130886221c5 Mon Sep 17 00:00:00 2001 From: Muki Kiboigo Date: Tue, 2 Sep 2025 09:25:33 -0700 Subject: [PATCH 2/2] update zig-v8-fork --- build.zig.zon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index c4cae4d1..5acbf006 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,8 +5,8 @@ .fingerprint = 0xda130f3af836cea0, .dependencies = .{ .v8 = .{ - .url = "https://github.com/lightpanda-io/zig-v8-fork/archive/299f44bbdf679def53882c7c45dbadd20f750acd.tar.gz", - .hash = "v8-0.0.0-xddH6xHEAwCo_OGkWshjXdYHGk18oSG3XZPYtf4tvF0P", + .url = "https://github.com/lightpanda-io/zig-v8-fork/archive/d3040a953e5a37290dae20e7ddf138b7aeb5e67d.tar.gz", + .hash = "v8-0.0.0-xddH6w_EAwA8vK0NAxfxfI7IcbnpkUAcXKNujn7qwnmY", }, //.v8 = .{ .path = "../zig-v8-fork" } },