aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-20 18:09:24 -0800
committerFuwn <[email protected]>2026-01-20 18:26:19 -0800
commit8a904e34154dec998aa64cc0666e84e1f1ee7b99 (patch)
treeeae1e1b64e131ab30df988a263019e3b18f14c91 /flake.nix
parentadd README.md (diff)
downloadzigr-8a904e34154dec998aa64cc0666e84e1f1ee7b99.tar.xz
zigr-8a904e34154dec998aa64cc0666e84e1f1ee7b99.zip
build: Add macOS support using Nix
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..3b1af92
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,51 @@
+{
+ description = "Zig bindings for TIGR";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs =
+ {
+ self,
+ nixpkgs,
+ flake-utils,
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+
+ linuxDeps = with pkgs; [
+ xorg.libX11
+ libGL
+ libGLU
+ ];
+
+ darwinDeps = with pkgs; [
+ apple-sdk_15
+ libiconv
+ ];
+ in
+ {
+ devShells.default = pkgs.mkShell.override { stdenv = pkgs.stdenvNoCC; } {
+ packages =
+ [
+ pkgs.zig
+ ]
+ ++ pkgs.lib.optionals pkgs.stdenv.isLinux ([ pkgs.pkg-config ] ++ linuxDeps)
+ ++ pkgs.lib.optionals pkgs.stdenv.isDarwin darwinDeps;
+
+ env = pkgs.lib.optionalAttrs pkgs.stdenv.isDarwin {
+ SDKROOT = "${pkgs.apple-sdk_15.sdkroot}";
+ };
+
+ shellHook = ''
+ echo "ZIGR development shell"
+ echo "Zig version: $(zig version)"
+ '';
+ };
+ }
+ );
+}