init
This commit is contained in:
commit
7e9790fc73
1 changed files with 231 additions and 0 deletions
88
flake.nix
Normal file
88
flake.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
description = "A Zig program using dear_imgui_zig";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
|
||||
zig-flake = {
|
||||
url = "github:silversquirl/zig-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# zls no longer needs the compat branch — it uses zig-flake directly
|
||||
zls = {
|
||||
url = "github:zigtools/zls/0.16.0";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
zig-flake.follows = "zig-flake";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs@{
|
||||
flake-parts,
|
||||
nixpkgs,
|
||||
zig-flake,
|
||||
zls,
|
||||
...
|
||||
}:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
imports = [
|
||||
flake-parts.flakeModules.easyOverlay
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
system,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
zigPkgs = zig-flake.packages.${system};
|
||||
zlsPkg = zls.packages.${system}.zls;
|
||||
pkg =
|
||||
{
|
||||
buildMode ? "fast",
|
||||
}:
|
||||
zigPkgs.default.makePackage {
|
||||
pname = "imgui_binds";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
zigReleaseMode = buildMode;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
overlayAttrs = {
|
||||
inherit (config.packages) imgui_binds;
|
||||
};
|
||||
packages.imgui_binds = pkg { };
|
||||
packages.debug = pkg {
|
||||
buildMode = "debug";
|
||||
};
|
||||
packages.default = config.packages.imgui_binds;
|
||||
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = [
|
||||
zlsPkg
|
||||
];
|
||||
inputsFrom = [ config.packages.default ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue