-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
55 lines (48 loc) · 1.34 KB
/
default.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
{ lib
, stdenv
, beamPackages
, mkYarnModules
, nodejs
, esbuild
}:
let
pname = "lanpartyseating";
version = "1.0.0";
src = ./.;
# TODO consider using `mix2nix` as soon as it supports git dependencies.
mixFodDeps = beamPackages.fetchMixDeps {
pname = "${pname}-deps";
inherit src version;
hash = "sha256-i0Ke1iqNQOnJHTD61Nk8BshwKQvjpmI+Kbac+fk294E=";
};
yarnDeps = mkYarnModules {
pname = "${pname}-yarn-deps";
inherit version;
packageJSON = ./assets/package.json;
yarnLock = ./assets/yarn.lock;
postBuild = ''
cp -r ${mixFodDeps}/phoenix $out/node_modules
cp -r ${mixFodDeps}/phoenix_html $out/node_modules
cp -r ${mixFodDeps}/phoenix_live_view $out/node_modules
'';
};
in
beamPackages.mixRelease {
inherit pname version src mixFodDeps;
nativeBuildInputs = [ nodejs ];
preBuild = ''
export HOME=$TMPDIR
export MIX_ESBUILD_PATH=${esbuild}/bin/esbuild
ln -sf ${yarnDeps}/node_modules assets/node_modules
ln -sf ${esbuild}/bin/esbuild _build/esbuild-linux-x64
mix assets.deploy
mix phx.gen.release
'';
meta = with lib; {
license = licenses.mit;
homepage = "https://github.com/starcraft66/lanparty-seating";
description = "Seating management for freeplay events.";
maintainers = with maintainers; [ starcraft66 ];
platforms = platforms.unix;
};
}