63 lines
1.2 KiB
Nix
63 lines
1.2 KiB
Nix
|
|
{
|
||
|
|
description = "Empty Epsilon inspired bridge simulator";
|
||
|
|
inputs = {
|
||
|
|
nixpkgs.url = "github:nixos/nixpkgs/release-24.05";
|
||
|
|
rust-overlay = {
|
||
|
|
url = "github:oxalica/rust-overlay";
|
||
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
outputs = { self, nixpkgs, rust-overlay }:
|
||
|
|
let
|
||
|
|
inherit (nixpkgs) lib;
|
||
|
|
systems = ["x86_64-linux"];
|
||
|
|
systemClosure = attrs:
|
||
|
|
builtins.foldl' (acc: system:
|
||
|
|
lib.recursiveUpdate acc (attrs system)) {}
|
||
|
|
systems;
|
||
|
|
in
|
||
|
|
systemClosure (system:
|
||
|
|
let
|
||
|
|
inherit ((builtins.fromTOML (builtins.readFile ./Cargo.toml)).package) name;
|
||
|
|
pkgs = import nixpkgs {
|
||
|
|
inherit system;
|
||
|
|
overlays = [(import rust-overlay)];
|
||
|
|
};
|
||
|
|
toolchain = (
|
||
|
|
pkgs.rust-bin.fromRustupToolchainFile ./rust_toolchain.toml
|
||
|
|
);
|
||
|
|
rustPlatform = pkgs.makeRustPlatform
|
||
|
|
{
|
||
|
|
rustc = toolchain;
|
||
|
|
cargo = toolchain;
|
||
|
|
};
|
||
|
|
libPath = with pkgs; lib.makeLibraryPath [
|
||
|
|
openssl
|
||
|
|
SDL2
|
||
|
|
SDL_ttf
|
||
|
|
vulkan-loader
|
||
|
|
];
|
||
|
|
in
|
||
|
|
{
|
||
|
|
packages.${system}.default = pkgs.callPackage ./derivation.nix {
|
||
|
|
inherit name rustPlatform;
|
||
|
|
};
|
||
|
|
|
||
|
|
devShells.${system}.default = pkgs.mkShell {
|
||
|
|
buildInputs = with pkgs; [
|
||
|
|
toolchain
|
||
|
|
clang
|
||
|
|
llvmPackages.bintools
|
||
|
|
openssl
|
||
|
|
pkg-config
|
||
|
|
SDL2
|
||
|
|
SDL2_image
|
||
|
|
SDL2_ttf
|
||
|
|
];
|
||
|
|
|
||
|
|
LD_LIBRARY_PATH = libPath;
|
||
|
|
};
|
||
|
|
});
|
||
|
|
}
|