zenyx-engine/flake.nix

79 lines
2.1 KiB
Nix
Raw Normal View History

2025-03-22 18:19:01 -04:00
{
2025-03-22 21:58:27 -04:00
description = "Zenyx - A WSYWIG game engine written in rust ";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
2025-03-22 18:19:01 -04:00
rust-overlay.url = "github:oxalica/rust-overlay";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
2025-03-22 21:58:27 -04:00
alejandra.url = "github:kamadorueda/alejandra/3.1.0";
alejandra.inputs.nixpkgs.follows = "nixpkgs";
};
2025-03-22 18:19:01 -04:00
2025-03-22 21:58:27 -04:00
outputs = {
self,
nixpkgs,
utils,
rust-overlay,
alejandra,
...
}:
{
overlays.default = final: prev: {
2025-03-25 00:54:34 -04:00
zenyx = final.callPackage ./default.nix {};
2025-03-22 21:58:27 -04:00
};
}
// utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
(import rust-overlay)
];
};
2025-03-22 18:19:01 -04:00
buildInputs = with pkgs; [
2025-03-22 21:58:27 -04:00
vulkan-loader
libGL
2025-03-22 21:58:27 -04:00
wayland
libxkbcommon
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libX11
xorg.libxcb
pkg-config
2025-03-30 02:54:07 -04:00
kdePackages.kdialog
2025-03-22 18:19:01 -04:00
];
2025-03-22 21:58:27 -04:00
in {
packages = {
inherit (pkgs) zenyx;
default = pkgs.zenyx;
2025-04-01 18:05:07 -04:00
windows = let
pkgsCross = import nixpkgs {
system = "x86_64-linux";
crossSystem = nixpkgs.lib.systems.examples.mingwW64;
};
in pkgsCross.callPackage ./default.nix {};
2025-03-22 21:58:27 -04:00
};
devShells.default = pkgs.mkShell {
name = "zenyx";
nativeBuildInputs = with pkgs; [
2025-03-29 20:20:40 -04:00
(rust-bin.stable.latest.default.override {
extensions = ["rust-src" "cargo" "rustfmt" "clippy"];
})
2025-03-22 21:58:27 -04:00
pkg-config
];
buildInputs = buildInputs;
shellHook = ''
export PATH="$HOME/.cargo/bin:$PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}"
echo "Rust version: $(rustc --version)"
2025-03-22 21:58:27 -04:00
'';
};
formatter = alejandra.packages.${system}.default;
}
);
2025-03-22 18:19:01 -04:00
}