forked from mitchellh/zig-libuv
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2f795b9
Showing
4 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# If we are a computer with nix-shell available, then use that to setup | ||
# the build environment with exactly what we need. | ||
if has nix; then | ||
use nix | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
description = "An empty project that uses Zig."; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/release-22.05"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
zig.url = "github:mitchellh/zig-overlay"; | ||
|
||
# Used for shell.nix | ||
flake-compat = { | ||
url = github:edolstra/flake-compat; | ||
flake = false; | ||
}; | ||
}; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
flake-utils, | ||
... | ||
} @ inputs: let | ||
overlays = [ | ||
# Other overlays | ||
(final: prev: { | ||
zigpkgs = inputs.zig.packages.${prev.system}; | ||
}) | ||
]; | ||
|
||
# Our supported systems are the same supported systems as the Zig binaries | ||
systems = builtins.attrNames inputs.zig.packages; | ||
in | ||
flake-utils.lib.eachSystem systems ( | ||
system: let | ||
pkgs = import nixpkgs {inherit overlays system;}; | ||
in rec { | ||
devShells.default = pkgs.mkShell { | ||
nativeBuildInputs = with pkgs; [ | ||
zigpkgs.master | ||
]; | ||
}; | ||
|
||
# For compatibility with older versions of the `nix` binary | ||
devShell = self.devShells.${system}.default; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(import | ||
( | ||
let | ||
flake-compat = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.flake-compat; | ||
in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${flake-compat.locked.rev}.tar.gz"; | ||
sha256 = flake-compat.locked.narHash; | ||
} | ||
) | ||
{src = ./.;}) | ||
.shellNix |