Providing a shell.nix file for more conveniently fetching the compatible Zig version #1432

Open
sstitle wants to merge 1 commit from sstitle/add-shell-nix-macos-0.4 into 0.4
sstitle commented 2025-10-05 21:33:11 +00:00 (Migrated from github.com)

When trying out the examples for this repo, I was unable to run them on my machine due to a version mismatch with the most up-to-date version of Zig (v0.15.1).

In my opinion, it would be convenient to have a nice way to pull the correct version of Zig compatible with the repo for new users to have a more seamless experience when trying out the repo.

This is a "shell.nix" file for the 0.4 tagged branch. It looks for the .zigversion file in the repo root and fetches the appropriate version of Zig and makes it available on the command line. You can enter the Nix shell by running nix-shell from the repo root as long as you have Nix installed. I like to install Nix using the convenient installer that you can find here from Determinate Systems.

Screenshot 2025-10-05 at 5 32 47 PM
  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
When trying out the examples for this repo, I was unable to run them on my machine due to a version mismatch with the most up-to-date version of Zig (v0.15.1). In my opinion, it would be convenient to have a nice way to pull the correct version of Zig compatible with the repo for new users to have a more seamless experience when trying out the repo. This is a ["shell.nix"](https://nix.dev/tutorials/first-steps/declarative-shell.html) file for the 0.4 tagged branch. It looks for the `.zigversion` file in the repo root and fetches the appropriate version of Zig and makes it available on the command line. You can enter the Nix shell by running `nix-shell` from the repo root as long as you have Nix installed. I like to install Nix using the convenient installer that you can find here from [Determinate Systems](https://docs.determinate.systems/determinate-nix/). <img width="1496" height="929" alt="Screenshot 2025-10-05 at 5 32 47 PM" src="https://github.com/user-attachments/assets/1cbf3bf0-e021-4d06-96e4-bab36ff27dc3" /> - [x] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin sstitle/add-shell-nix-macos-0.4:sstitle/add-shell-nix-macos-0.4
git switch sstitle/add-shell-nix-macos-0.4

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 0.4
git merge --no-ff sstitle/add-shell-nix-macos-0.4
git switch sstitle/add-shell-nix-macos-0.4
git rebase 0.4
git switch 0.4
git merge --ff-only sstitle/add-shell-nix-macos-0.4
git switch sstitle/add-shell-nix-macos-0.4
git rebase 0.4
git switch 0.4
git merge --no-ff sstitle/add-shell-nix-macos-0.4
git switch 0.4
git merge --squash sstitle/add-shell-nix-macos-0.4
git switch 0.4
git merge --ff-only sstitle/add-shell-nix-macos-0.4
git switch 0.4
git merge sstitle/add-shell-nix-macos-0.4
git push origin 0.4
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!1432
No description provided.