-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
64 lines (62 loc) · 1.72 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
description = "Flake to manage node builds";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = {
self,
nixpkgs,
flake-utils,
rust-overlay,
}:
flake-utils.lib.eachDefaultSystem
(
system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {
inherit system overlays;
};
rust-bin = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rustPlatform = pkgs.makeRustPlatform {
cargo = rust-bin;
rustc = rust-bin;
};
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rust-bin
emscripten
];
shellHook = ''
export EM_CACHE=/tmp/emcache
'';
};
packages = rec {
godot-flappy-linux = rustPlatform.buildRustPackage {
pname = "godot-neural-networks";
version = "0.1.0";
src = ./rust/godot-neural-networks;
cargoLock = {
lockFile = ./rust/godot-neural-networks/Cargo.lock;
outputHashes = {
"gdextension-api-0.2.1" = "sha256-YkMbzObJGnmQa1XGT4ApRrfqAeOz7CktJrhYks8z0RY=";
"godot-0.2.2" = "sha256-k5gW74nRp8AUef2nJ5Fwcr2Vf5PVJqpEgrsacG6mp1g=";
};
};
nativeBuildInputs = [
rust-bin
];
};
default = godot-flappy-linux;
};
}
);
}