use zig overlay
This commit is contained in:
parent
847a11d293
commit
3f596a6dc9
111
flake.lock
111
flake.lock
|
@ -1,30 +1,61 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-parts": {
|
"flake-compat": {
|
||||||
"inputs": {
|
"flake": false,
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1693611461,
|
"lastModified": 1673956053,
|
||||||
"narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=",
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
"owner": "hercules-ci",
|
"owner": "edolstra",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-compat",
|
||||||
"rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca",
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "hercules-ci",
|
"owner": "edolstra",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1694529238,
|
||||||
|
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1659877975,
|
||||||
|
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1695806987,
|
"lastModified": 1696725822,
|
||||||
"narHash": "sha256-fX5kGs66NZIxCMcpAGIpxuftajHL8Hil1vjHmjjl118=",
|
"narHash": "sha256-B7uAOS7TkLlOg1aX01rQlYbydcyB6ZnLJSfaYbKVww8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f3dab3509afca932f3f4fd0908957709bb1c1f57",
|
"rev": "5aabb5780a11c500981993d49ee93cfa6df9307b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -32,28 +63,62 @@
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "lib",
|
"lastModified": 1689088367,
|
||||||
"lastModified": 1693471703,
|
"narHash": "sha256-Y2tl2TlKCWEHrOeM9ivjCLlRAKH3qoPUE/emhZECU14=",
|
||||||
"narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=",
|
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85",
|
"rev": "5c9ddb86679c400d6b7360797b8a22167c2053f8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"dir": "lib",
|
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"ref": "release-23.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"zig": "zig"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zig": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696810944,
|
||||||
|
"narHash": "sha256-yvt223HLZlAJa/u4uzT5aw3ph2bifto/KfU2k+eX+jg=",
|
||||||
|
"owner": "mitchellh",
|
||||||
|
"repo": "zig-overlay",
|
||||||
|
"rev": "6dc03885321cc8aad6356c847148eb40e167f9fb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mitchellh",
|
||||||
|
"repo": "zig-overlay",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
59
flake.nix
59
flake.nix
|
@ -1,48 +1,47 @@
|
||||||
{
|
{
|
||||||
description = "FabApp";
|
description = "FabApp";
|
||||||
|
|
||||||
|
# Inspired by https://github.com/mitchellh/zig-objc/blob/main/flake.nix
|
||||||
inputs = {
|
inputs = {
|
||||||
# take unstable if not specified
|
# take unstable if not specified
|
||||||
# nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
|
# nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
# nixpkgs.url = "github:NixOS/nixpkgs/unstable";
|
||||||
};
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
zig.url = "github:mitchellh/zig-overlay";
|
||||||
outputs = inputs@{ flake-parts, nixpkgs, ... }:
|
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
||||||
flake = {
|
|
||||||
# Put your original flake attributes here.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
...
|
||||||
|
} @ inputs: let
|
||||||
|
overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
zigpkgs = inputs.zig.packages.${prev.system};
|
||||||
|
})
|
||||||
|
];
|
||||||
systems = ["x86_64-linux"];
|
systems = ["x86_64-linux"];
|
||||||
|
in
|
||||||
# https://flake.parts/module-arguments.html#persystem-module-parameters
|
flake-utils.lib.eachSystem systems (
|
||||||
perSystem = { pkgs, system, ... }: {
|
system: let
|
||||||
_module.args.pkgs = import nixpkgs {
|
pkgs = import nixpkgs {inherit overlays system;};
|
||||||
inherit system;
|
in rec {
|
||||||
# config.allowUnfree = true;
|
devShells.default = pkgs.mkShell {
|
||||||
};
|
nativeBuildInputs = with pkgs; [
|
||||||
|
zigpkgs.master
|
||||||
devShells.default = with pkgs;
|
|
||||||
mkShell {
|
|
||||||
buildInputs = [
|
|
||||||
sqlite
|
|
||||||
|
|
||||||
# Zig / webAssembly impl.
|
|
||||||
zig
|
|
||||||
zls
|
zls
|
||||||
emscripten
|
emscripten
|
||||||
|
];
|
||||||
# Tools
|
buildInputs = with pkgs; [
|
||||||
nixfmt
|
sqlite
|
||||||
|
|
||||||
# Linux graphical deps
|
# Linux graphical deps
|
||||||
xorg.libX11
|
xorg.libX11
|
||||||
libGL
|
libGL
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
formatter = pkgs.nixfmt;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
formatter = pkgs.alejandra;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue