use zig overlay
This commit is contained in:
parent
2162e114fc
commit
d9204132ee
2 changed files with 119 additions and 57 deletions
65
flake.nix
65
flake.nix
|
@ -1,44 +1,41 @@
|
|||
{
|
||||
description = "FabApp";
|
||||
|
||||
# Inspired by https://github.com/mitchellh/zig-objc/blob/main/flake.nix
|
||||
inputs = {
|
||||
# take unstable if not specified
|
||||
# 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.
|
||||
};
|
||||
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
# https://flake.parts/module-arguments.html#persystem-module-parameters
|
||||
perSystem = { pkgs, system, ... }: {
|
||||
_module.args.pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
# config.allowUnfree = true;
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
} @ inputs: let
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
zigpkgs = inputs.zig.packages.${prev.system};
|
||||
})
|
||||
];
|
||||
systems = ["x86_64-linux"];
|
||||
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
|
||||
zls
|
||||
emscripten
|
||||
sqlite
|
||||
];
|
||||
};
|
||||
|
||||
devShells.default = with pkgs;
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
sqlite
|
||||
|
||||
# Zig / webAssembly impl.
|
||||
zig
|
||||
zls
|
||||
emscripten
|
||||
|
||||
# Tools
|
||||
nixfmt
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
formatter = pkgs.nixfmt;
|
||||
};
|
||||
};
|
||||
formatter = pkgs.alejandra;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue