git.s-ol.nu alive / b9d51ab
use flake.nix instead of shell.nix s-ol 4 months ago
3 changed file(s) with 222 addition(s) and 154 deletion(s). Raw diff Collapse all Expand all
0 {
1 "nodes": {
2 "flake-utils": {
3 "locked": {
4 "lastModified": 1619345332,
5 "narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
6 "owner": "numtide",
7 "repo": "flake-utils",
8 "rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
9 "type": "github"
10 },
11 "original": {
12 "owner": "numtide",
13 "repo": "flake-utils",
14 "type": "github"
15 }
16 },
17 "nixpkgs": {
18 "locked": {
19 "lastModified": 1619792299,
20 "narHash": "sha256-hpg6wU0QLcNXj5/Nj8NT4p97R9SUGR8RBwjYNsMSKng=",
21 "owner": "NixOS",
22 "repo": "nixpkgs",
23 "rev": "be58d0fbaa401922a090735edfc08442aed69b47",
24 "type": "github"
25 },
26 "original": {
27 "owner": "NixOS",
28 "ref": "nixos-20.09",
29 "repo": "nixpkgs",
30 "type": "github"
31 }
32 },
33 "root": {
34 "inputs": {
35 "flake-utils": "flake-utils",
36 "nixpkgs": "nixpkgs"
37 }
38 }
39 },
40 "root": "root",
41 "version": 7
42 }
0 {
1 description = "alive";
2
3 inputs = {
4 nixpkgs.url = github:NixOS/nixpkgs/nixos-20.09;
5 flake-utils.url = "github:numtide/flake-utils";
6 };
7
8 outputs = { self, nixpkgs, flake-utils, ... } @ inputs:
9 flake-utils.lib.eachDefaultSystem (system:
10 with import nixpkgs { inherit system; };
11 let
12 mkLua = { lua, luaPkgs }:
13 let
14 luarocks-build-cpp = luaPkgs.buildLuarocksPackage rec {
15 pname = "luarocks-build-cpp";
16 version = "0.2.0-1";
17
18 knownRockspec = (pkgs.fetchurl {
19 url = "mirror://luarocks//${pname}-${version}.rockspec";
20 sha256 = "AzDZV9u6V71YNJFBfj3cR1COjFFWhGmsJkGsUMErSZs=";
21 }).outPath;
22
23 src = pkgs.fetchFromGitHub {
24 owner = "osch";
25 repo = pname;
26 rev = "v0.2.0";
27 sha256 = "PamppWdV3cQMDK+t2V09/cNRskGuRNeuyvUODmopLaQ=";
28 };
29 propagatedBuildInputs = [ lua ];
30
31 meta = with pkgs.stdenv.lib; {
32 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
33 description = "Lua binding to FLTK, the Fast Light ToolKit";
34 license.fullName = "MIT";
35 };
36 };
37
38 luarocks-fetch-gitrec = luaPkgs.buildLuarocksPackage rec {
39 pname = "luarocks-fetch-gitrec";
40 version = "0.2-2";
41
42 src = pkgs.fetchurl {
43 url = "mirror://luarocks//${pname}-${version}.src.rock";
44 sha256 = "Dp3bKIG4swrD4+1NNtRTgyj68Di2cSUlh1r7Z2Rkzn0=";
45 };
46 propagatedBuildInputs = with pkgs; [ lua git ];
47
48 meta = with pkgs.stdenv.lib; {
49 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
50 description = "Lua binding to FLTK, the Fast Light ToolKit";
51 license.fullName = "MIT";
52 };
53 };
54
55 fltk4lua = luaPkgs.buildLuarocksPackage rec {
56 pname = "fltk4lua";
57 version = "0.2-1";
58
59 src = pkgs.fetchurl {
60 url = "mirror://luarocks//${pname}-${version}.src.rock";
61 sha256 = "fD31FruqVriMecFcvSV4W7JRia38+bg7j3T5k5pFZec=";
62 };
63 buildInputs = with pkgs; [ fltk libjpeg ];
64 propagatedBuildInputs = [ lua luarocks-build-cpp luarocks-fetch-gitrec ];
65
66 meta = with pkgs.stdenv.lib; {
67 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
68 description = "Lua binding to FLTK, the Fast Light ToolKit";
69 license.fullName = "MIT";
70 };
71 };
72
73 losc = luaPkgs.buildLuarocksPackage rec {
74 pname = "losc";
75 version = "1.0.0-1";
76
77 src = pkgs.fetchurl {
78 url = "mirror://luarocks//${pname}-${version}.src.rock";
79 sha256 = "MArhj51V1awF5k2zToFYEXpS2c6o8bnNDn4wLhooHos=";
80 };
81 buildInputs = with pkgs; [ stdenv.cc.cc.lib ];
82 propagatedBuildInputs = [ lua ];
83
84 meta = with pkgs.stdenv.lib; {
85 homepage = "https://github.com/davidgranstrom/losc";
86 description = "Open Sound Control (OSC) for lua/luajit with no external dependencies.";
87 license.fullName = "MIT";
88 };
89 };
90
91 discount = luaPkgs.buildLuarocksPackage {
92 pname = "discount";
93 version = "0.4-1";
94
95 knownRockspec = (pkgs.fetchurl {
96 url = https://luarocks.org/discount-0.4-1.rockspec;
97 sha256 = "0mc2mwkprf8li2v91vga77rwi0xhv989nxshi66z2d45lbl1dcpd";
98 }).outPath;
99
100 src = pkgs.fetchurl {
101 url = https://craigbarnes.gitlab.io/dist/lua-discount/lua-discount-0.4.tar.gz;
102 sha256 = "1bfyrxjr26gbahawdynlbp48ma01gyd3b6xbljvxb2aavvfywc9m";
103 };
104
105 buildInputs = [ pkgs.discount ];
106 propagatedBuildInputs = [ lua ];
107
108 meta = with pkgs.stdenv.lib; {
109 homepage = "https://github.com/craigbarnes/lua-discount";
110 description = "Lua bindings for the Discount Markdown library";
111 license.fullName = "ISC";
112 };
113 };
114
115 ldoc = luaPkgs.buildLuarocksPackage rec {
116 pname = "ldoc";
117 version = "scm-2";
118
119 knownRockspec = (pkgs.fetchurl {
120 url = "mirror://luarocks//${pname}-${version}.rockspec";
121 sha256 = "PHQhpQPfmlPhwIXoce5WZ+eoARmSecy1ac7Bfu4zg38=";
122 }).outPath;
123
124 src = pkgs.fetchFromGitHub {
125 owner = "s-ol";
126 repo = "LDoc";
127 rev = "moonscript";
128 sha256 = "3jieGp9++cWtLMKccP+xqrtdCiNG/9BYZlHmH1l8XV8=";
129 };
130 propagatedBuildInputs = with luaPkgs; [
131 lua penlight markdown
132 ];
133
134 meta = with pkgs.stdenv.lib; {
135 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
136 description = "Lua binding to FLTK, the Fast Light ToolKit";
137 license.fullName = "MIT";
138 };
139 };
140 in
141 (lua.withPackages (p: with p; [
142 moonscript lpeg
143 luafilesystem luasocket luasystem fltk4lua losc bit32
144 ldoc busted discount
145 ]));
146 in rec {
147 packages.alive-env-lua53 = stdenv.mkDerivation {
148 name = "alive-env-lua53";
149 src = self;
150
151 nativeBuildInputs = with pkgs; [ (mkLua { lua = lua5_3; luaPkgs = lua53Packages; }) ];
152
153 shellHook = ''
154 export LUA_PATH="?.lua;?/init.lua"
155 '';
156 };
157
158 packages.alive-env-luajit = stdenv.mkDerivation {
159 name = "alive-env-luajit";
160 src = self;
161
162 nativeBuildInputs = with pkgs; [
163 (mkLua { lua = luajit; luaPkgs = luajitPackages; })
164 love_11
165 ];
166
167 shellHook = ''
168 source <(
169 LUA_PATH="?.lua;?/init.lua" luajit -e \
170 "print(string.format('export LUA_PATH=%q; export LUA_CPATH=%q', package.path, package.cpath))"
171 )
172 '';
173 };
174
175 defaultPackage = packages.alive-env-luajit;
176 }
177 );
178 }
+0
-154
shell.nix less more
0 { pkgs ? import <nixpkgs> {}
1 }:
2
3 let
4 # lua = pkgs.lua5_3;
5 # luaPkgs = pkgs.lua53Packages;
6 lua = pkgs.luajit;
7 luaPkgs = pkgs.luajitPackages;
8
9 luarocks-build-cpp = luaPkgs.buildLuarocksPackage rec {
10 pname = "luarocks-build-cpp";
11 version = "0.2.0-1";
12
13 knownRockspec = (pkgs.fetchurl {
14 url = "mirror://luarocks//${pname}-${version}.rockspec";
15 sha256 = "AzDZV9u6V71YNJFBfj3cR1COjFFWhGmsJkGsUMErSZs=";
16 }).outPath;
17
18 src = pkgs.fetchFromGitHub {
19 owner = "osch";
20 repo = pname;
21 rev = "v0.2.0";
22 sha256 = "PamppWdV3cQMDK+t2V09/cNRskGuRNeuyvUODmopLaQ=";
23 };
24 propagatedBuildInputs = [ lua ];
25
26 meta = with pkgs.stdenv.lib; {
27 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
28 description = "Lua binding to FLTK, the Fast Light ToolKit";
29 license.fullName = "MIT";
30 };
31 };
32
33 luarocks-fetch-gitrec = luaPkgs.buildLuarocksPackage rec {
34 pname = "luarocks-fetch-gitrec";
35 version = "0.2-2";
36
37 src = pkgs.fetchurl {
38 url = "mirror://luarocks//${pname}-${version}.src.rock";
39 sha256 = "Dp3bKIG4swrD4+1NNtRTgyj68Di2cSUlh1r7Z2Rkzn0=";
40 };
41 propagatedBuildInputs = with pkgs; [ lua git ];
42
43 meta = with pkgs.stdenv.lib; {
44 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
45 description = "Lua binding to FLTK, the Fast Light ToolKit";
46 license.fullName = "MIT";
47 };
48 };
49
50 fltk4lua = luaPkgs.buildLuarocksPackage rec {
51 pname = "fltk4lua";
52 version = "0.2-1";
53
54 src = pkgs.fetchurl {
55 url = "mirror://luarocks//${pname}-${version}.src.rock";
56 sha256 = "fD31FruqVriMecFcvSV4W7JRia38+bg7j3T5k5pFZec=";
57 };
58 buildInputs = with pkgs; [ fltk libjpeg ];
59 propagatedBuildInputs = [ lua luarocks-build-cpp luarocks-fetch-gitrec ];
60
61 meta = with pkgs.stdenv.lib; {
62 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
63 description = "Lua binding to FLTK, the Fast Light ToolKit";
64 license.fullName = "MIT";
65 };
66 };
67
68 losc = luaPkgs.buildLuarocksPackage rec {
69 pname = "losc";
70 version = "1.0.0-1";
71
72 src = pkgs.fetchurl {
73 url = "mirror://luarocks//${pname}-${version}.src.rock";
74 sha256 = "MArhj51V1awF5k2zToFYEXpS2c6o8bnNDn4wLhooHos=";
75 };
76 buildInputs = with pkgs; [ stdenv.cc.cc.lib ];
77 propagatedBuildInputs = [ lua ];
78
79 meta = with pkgs.stdenv.lib; {
80 homepage = "https://github.com/davidgranstrom/losc";
81 description = "Open Sound Control (OSC) for lua/luajit with no external dependencies.";
82 license.fullName = "MIT";
83 };
84 };
85
86 discount = luaPkgs.buildLuarocksPackage {
87 pname = "discount";
88 version = "0.4-1";
89
90 knownRockspec = (pkgs.fetchurl {
91 url = https://luarocks.org/discount-0.4-1.rockspec;
92 sha256 = "0mc2mwkprf8li2v91vga77rwi0xhv989nxshi66z2d45lbl1dcpd";
93 }).outPath;
94
95 src = pkgs.fetchurl {
96 url = https://craigbarnes.gitlab.io/dist/lua-discount/lua-discount-0.4.tar.gz;
97 sha256 = "1bfyrxjr26gbahawdynlbp48ma01gyd3b6xbljvxb2aavvfywc9m";
98 };
99
100 buildInputs = [ pkgs.discount ];
101 propagatedBuildInputs = [ lua ];
102
103 meta = with pkgs.stdenv.lib; {
104 homepage = "https://github.com/craigbarnes/lua-discount";
105 description = "Lua bindings for the Discount Markdown library";
106 license.fullName = "ISC";
107 };
108 };
109
110 ldoc = luaPkgs.buildLuarocksPackage rec {
111 pname = "ldoc";
112 version = "scm-2";
113
114 knownRockspec = (pkgs.fetchurl {
115 url = "mirror://luarocks//${pname}-${version}.rockspec";
116 sha256 = "PHQhpQPfmlPhwIXoce5WZ+eoARmSecy1ac7Bfu4zg38=";
117 }).outPath;
118
119 src = pkgs.fetchFromGitHub {
120 owner = "s-ol";
121 repo = "LDoc";
122 rev = "moonscript";
123 sha256 = "3jieGp9++cWtLMKccP+xqrtdCiNG/9BYZlHmH1l8XV8=";
124 };
125 propagatedBuildInputs = with luaPkgs; [
126 lua penlight markdown
127 ];
128
129 meta = with pkgs.stdenv.lib; {
130 homepage = "https://github.com/siffiejoe/lua-fltk4lua/";
131 description = "Lua binding to FLTK, the Fast Light ToolKit";
132 license.fullName = "MIT";
133 };
134 };
135
136 in pkgs.mkShell {
137 name = "alv-env";
138 buildInputs = with pkgs; [
139 (lua.withPackages (p: with p; [
140 moonscript lpeg
141 luafilesystem luasocket luasystem fltk4lua losc bit32
142 ldoc busted discount
143 ]))
144 love_11
145 ];
146 shellHook = ''
147 echo 'setting paths'
148 source <(
149 LUA_PATH="?.lua;?/init.lua" luajit -e \
150 "print(string.format('export LUA_PATH=%q; export LUA_CPATH=%q', package.path, package.cpath))"
151 )
152 '';
153 }