init
This commit is contained in:
commit
b38a3b7bda
1 changed files with 801 additions and 0 deletions
79
flake.nix
Normal file
79
flake.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
description = "A Zig program using dear_imgui_zig";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
|
||||
zig2nix = {
|
||||
url = "github:Cloudef/zig2nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
zls = {
|
||||
url = "github:zigtools/zls/0.16.0";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs@{
|
||||
flake-parts,
|
||||
nixpkgs,
|
||||
zig2nix,
|
||||
zls,
|
||||
...
|
||||
}:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
system,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
env = zig2nix.outputs.zig-env.${system} { };
|
||||
zlsPkg = zls.packages.${system}.zls;
|
||||
in
|
||||
{
|
||||
packages.emu_ui = env.package {
|
||||
src = ./.;
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
libGL
|
||||
wayland
|
||||
wayland-protocols
|
||||
];
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
zigWrapperLibs = with pkgs; [
|
||||
wayland
|
||||
libGL
|
||||
];
|
||||
};
|
||||
|
||||
packages.default = config.packages.emu_ui;
|
||||
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = [ zlsPkg ];
|
||||
inputsFrom = [ config.packages.default ];
|
||||
|
||||
shellHook = ''
|
||||
echo "zig $(zig version)"
|
||||
echo "zls $(zls --version)"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue