-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
254 lines (216 loc) · 8.44 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
{
description = "alive";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem (
system:
with import nixpkgs {inherit system;}; let
mkDeps = luaPkgs: let
luarocks-build-cpp = luaPkgs.buildLuarocksPackage rec {
pname = "luarocks-build-cpp";
version = "0.2.0-1";
knownRockspec =
(pkgs.fetchurl {
url = "mirror://luarocks/${pname}-${version}.rockspec";
hash = "sha256-AzDZV9u6V71YNJFBfj3cR1COjFFWhGmsJkGsUMErSZs=";
})
.outPath;
src = pkgs.fetchFromGitHub {
owner = "osch";
repo = pname;
rev = "v0.2.0";
hash = "sha256-PamppWdV3cQMDK+t2V09/cNRskGuRNeuyvUODmopLaQ=";
};
propagatedBuildInputs = [luaPkgs.lua];
meta = {
homepage = "https://github.com/osch/luarocks-build-cpp";
description = "A fork of built-in build system for C++ rocks";
license = lib.licenses.mit;
};
};
luarocks-fetch-gitrec = luaPkgs.buildLuarocksPackage rec {
pname = "luarocks-fetch-gitrec";
version = "0.2-2";
src = pkgs.fetchurl {
url = "mirror://luarocks/${pname}-${version}.src.rock";
hash = "sha256-Dp3bKIG4swrD4+1NNtRTgyj68Di2cSUlh1r7Z2Rkzn0=";
};
postUnpack = "sourceRoot=$sourceRoot/luarocks-fetch-gitrec-0.2";
propagatedBuildInputs = with pkgs; [luaPkgs.lua git];
meta = {
homepage = "https://github.com/siffiejoe/luarocks-fetch-gitrec";
description = "Lua binding to FLTK, the Fast Light ToolKit";
license = lib.licenses.mit;
};
};
fltk4lua = luaPkgs.buildLuarocksPackage rec {
pname = "fltk4lua";
version = "0.2-1";
src = pkgs.fetchurl {
url = "mirror://luarocks/${pname}-${version}.src.rock";
hash = "sha256-fD31FruqVriMecFcvSV4W7JRia38+bg7j3T5k5pFZec=";
};
postUnpack = "sourceRoot=$sourceRoot/lua-fltk4lua";
buildInputs = with pkgs; [fltk libjpeg];
propagatedBuildInputs = [luaPkgs.lua luarocks-build-cpp luarocks-fetch-gitrec];
meta = {
homepage = "https://github.com/siffiejoe/lua-fltk4lua";
description = "Lua binding to FLTK, the Fast Light ToolKit";
license = lib.licenses.mit;
};
};
losc = luaPkgs.buildLuarocksPackage rec {
pname = "losc";
version = "1.0.0-1";
src = pkgs.fetchurl {
url = "mirror://luarocks/${pname}-${version}.src.rock";
hash = "sha256-MArhj51V1awF5k2zToFYEXpS2c6o8bnNDn4wLhooHos=";
};
postUnpack = "sourceRoot=$sourceRoot/losc";
buildInputs = with pkgs; [stdenv.cc.cc.lib];
propagatedBuildInputs = [luaPkgs.lua];
meta = {
homepage = "https://github.com/davidgranstrom/losc";
description = "Open Sound Control (OSC) for lua/luajit with no external dependencies.";
license = lib.licenses.mit;
};
};
discount = luaPkgs.buildLuarocksPackage {
pname = "discount";
version = "0.4-1";
knownRockspec =
(pkgs.fetchurl {
url = mirror://luarocks/discount-0.4-1.rockspec;
hash = "sha256-7bIW6KKFNPGNiVB3m1DasIPI8znq7ZC2iBS5fCevglU=";
})
.outPath;
src = pkgs.fetchurl {
url = https://craigbarnes.gitlab.io/dist/lua-discount/lua-discount-0.4.tar.gz;
hash = "sha256-NTHu3d5KidW3pKubNZp/AaiKyF3U+sYVVOsZkWXP3q0=";
};
buildInputs = [pkgs.discount];
propagatedBuildInputs = [luaPkgs.lua];
meta = {
homepage = "https://github.com/craigbarnes/lua-discount";
description = "Lua bindings for the Discount Markdown library";
license = lib.licenses.isc;
};
};
ldoc = luaPkgs.buildLuarocksPackage rec {
pname = "ldoc";
version = "scm-2";
knownRockspec =
(pkgs.fetchurl {
url = "mirror://luarocks/${pname}-${version}.rockspec";
hash = "sha256-PHQhpQPfmlPhwIXoce5WZ+eoARmSecy1ac7Bfu4zg38=";
})
.outPath;
src = pkgs.fetchFromGitHub {
owner = "s-ol";
repo = "LDoc";
rev = "moonscript";
hash = "sha256-3jieGp9++cWtLMKccP+xqrtdCiNG/9BYZlHmH1l8XV8=";
};
propagatedBuildInputs = with luaPkgs; [
lua
penlight
markdown
];
meta = {
homepage = "https://github.com/s-ol/LDoc";
description = "A Lua Documentation Tool";
license = lib.licenses.mit;
};
};
lua-rtmidi = luaPkgs.buildLuarocksPackage rec {
pname = "lua-rtmidi";
version = "1.0.0-1";
# src = pkgs.fetchurl {
# url = "mirror://luarocks/${pname}-${version}.src.rock";
# hash = "sha256-DmSfrQRX8oziH+vvwq3KIdvjTX7P4zeKc6NeTygoU3A=";
# };
src = pkgs.fetchFromGitHub {
owner = "s-ol";
repo = "lua-rtmidi";
rev = "v1.0.0";
hash = "sha256-DmSfrQRX8oziH+vvwq3KIdvjTX7P4zeKc6NeTygoU3A=";
};
buildInputs = with pkgs; [stdenv.cc.cc.lib];
propagatedBuildInputs = with pkgs; [luaPkgs.lua alsa-lib libjack2];
meta = {
homepage = "https://github.com/s-ol/lua-rtmidi";
description = "Lua bindings for RtMidi";
license = lib.licenses.bsd2;
};
};
in
with luaPkgs;
[
moonscript
lpeg
luafilesystem
luasocket
luasystem
fltk4lua
losc
busted
discount
lua-rtmidi
]
++ (
if lib.strings.versionAtLeast luaPkgs.lua.version "5.4"
then []
else [bit32 ldoc]
);
mkEnv = lua:
stdenv.mkDerivation {
name = "alive-env-${lua.name}";
src = self;
propagatedBuildInputs = [(lua.withPackages mkDeps)];
shellHook = ''
export LUA_PATH="?.lua;?/init.lua"
'';
};
in rec {
packages.alive = lua53Packages.buildLuarocksPackage rec {
pname = "alive";
version = "scm-10";
src = ./.;
knownRockspec = ./dist/rocks/${pname}-${version}.rockspec;
propagatedBuildInputs = [(pkgs.lua5_3.withPackages mkDeps)];
meta = {
homepage = "https://alv.s-ol.nu";
description = "experimental livecoding environment with persistent expressions";
license = lib.licenses.gpl3;
};
};
defaultPackage = packages.alive;
defaultApp = {
type = "app";
program = "${defaultPackage}/bin/alv-fltk";
};
devShells.lua53 = mkEnv pkgs.lua5_3;
devShells.lua54 = mkEnv pkgs.lua5_4;
devShells.luajit = stdenv.mkDerivation {
name = "alive-env-luajit";
src = self;
propagatedBuildInputs = [(luajit.withPackages mkDeps) love_11];
shellHook = ''
source <(
LUA_PATH="?.lua;?/init.lua" luajit -e \
"print(string.format('export LUA_PATH=%q; export LUA_CPATH=%q', package.path, package.cpath))"
)
'';
};
devShell = devShells.lua53;
}
);
}