-
Notifications
You must be signed in to change notification settings - Fork 3
/
default-plugins.nix
54 lines (54 loc) · 1.16 KB
/
default-plugins.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
{
cargo,
cargoLock,
pkgs,
protobuf,
rustc,
src,
stdenv,
binaryen,
optimize ? true,
}:
let
makeDefaultPlugin =
name:
(pkgs.makeRustPlatform { inherit cargo rustc; }).buildRustPackage {
inherit
cargoLock
name
src
stdenv
;
nativeBuildInputs = [
binaryen
protobuf
];
buildPhase = ''
cargo build --package ${name} --release --target=wasm32-wasi
mkdir -p $out/bin;
'';
installPhase =
if optimize then
''
wasm-opt \
-Oz target/wasm32-wasi/release/${name}.wasm \
-o $out/bin/${name}.wasm \
--enable-bulk-memory
''
else
''
mv \
target/wasm32-wasi/release/${name}.wasm \
$out/bin/${name}.wasm
'';
doCheck = false;
};
in
{
compact-bar = makeDefaultPlugin "compact-bar";
configuration = makeDefaultPlugin "configuration";
session-manager = makeDefaultPlugin "session-manager";
status-bar = makeDefaultPlugin "status-bar";
strider = makeDefaultPlugin "strider";
tab-bar = makeDefaultPlugin "tab-bar";
}