-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
executable file
·99 lines (95 loc) · 2.57 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
description = "flake to help build a haxe project";
inputs = {
# latest nixpkgs
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# haxe : the language
haxe = {
type = "git";
url = "https://github.com/HaxeFoundation/haxe.git";
ref = "development";
flake = false;
submodules = true;
};
# hashlink : the haxe interpreter
hashlink = {
url = "github:HaxeFoundation/hashlink?ref=refs/tags/latest";
flake = false;
};
# Dox : the documentation tool
dox = {
url = "github:HaxeFoundation/dox";
flake = false;
};
# format : the format support library
haxe_format = {
url = "github:HaxeFoundation/format";
flake = false;
};
# hxcpp : runtime support for the C++ backend
# of the Haxe compiler.
hxcpp = {
url = "github:HaxeFoundation/hxcpp?ref=refs/tags/v4.3.15";
flake = false;
};
# heaps : the game engine
heaps = {
url = "github:HeapsIO/heaps";
flake = false;
};
# raylib source code
raylib = {
url = "github:Raysan5/raylib?ref=refs/tags/5.0";
flake = false;
};
# raylib haxe bindings
raylib-hx = {
url = "github:foreignsasquatch/raylib-hx";
flake = false;
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
# multiplatform support
systems = [
"x86_64-linux"
# "aarch64-linux" <- not supported yet
"aarch64-darwin"
"x86_64-darwin"
];
# the actual flake for every system
flake =
system:
let
pkgs = import nixpkgs { inherit system; };
packages = pkgs.callPackage ./pkgs { inherit inputs; };
demos = pkgs.callPackage ./demo ({ inherit inputs; } // packages);
in
{
legacyPackages."${system}" = packages;
devShells."${system}" = pkgs.callPackages ./pkgs/shell.nix packages;
# TODO :
#checks."${system}" = demos;
};
in
{
# template for heaps projects :
templates =
rec {
default = heaps; # we might not wanna be that opiniated
heaps = {
path = ./templates/heaps;
description = "A simple haxe game with heaps";
welcomeText = "";
};
lime = {
path = ./templates/lime;
description = "A simple haxe project with lime";
welcomeText = "";
};
};
}
# gen for all systems :
// (builtins.foldl' (x: y: nixpkgs.lib.recursiveUpdate x y) { } (map flake systems));
}