Skip to content

Commit

Permalink
Add nix flake with dev shell (#2)
Browse files Browse the repository at this point in the history
👷 add nix flake with dev shell

Co-authored-by: Abdel @ StarkWare <45264458+abdelhamidbakhta@users.noreply.github.com>
  • Loading branch information
fracek and AbdelStark authored Oct 24, 2023
1 parent d70e508 commit 230644d
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

- [Zig](https://ziglang.org/)

Alternatively, if you have [nix](https://nixos.org/) installed, you can get the full development environment `nix develop`.

## ⚡ Wanna learn Zig fast?

- [Zig language reference](https://ziglang.org/documentation/master/)
Expand Down
115 changes: 115 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
};
zig = {
url = "github:mitchellh/zig-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, flake-utils, zig, ... }:
let
overlays = [ zig.overlays.default ];
# Support only systems supported by the zig overlay.
systems = builtins.attrNames zig.packages;
in
flake-utils.lib.eachSystem systems (system:
let
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
# format with `nix fmt`
formatter = pkgs.nixpkgs-fmt;

devShell = pkgs.mkShell {
# Add native packages needed to build the cairo vm here.
# You can find packages at https://search.nixos.org/packages
nativeBuildInputs = with pkgs; [
zigpkgs.master
];
};
}
);
}

0 comments on commit 230644d

Please sign in to comment.