Initial commit
This commit is contained in:
commit
3ee50f9aff
6 changed files with 158 additions and 0 deletions
62
flake.nix
Normal file
62
flake.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
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;
|
||||
};
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue