-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathci.nix
111 lines (83 loc) · 2.31 KB
/
ci.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
{pkgs ? import <nixpkgs> {overlays = [(import ./nix)];}}: let
buildPhase = ''
mkdir -p $out
deno run -A ./main.ts > $out/output.txt
'';
nvfetcher = pkgs.callPackage ./_sources/generated.nix {};
esbuild = nvfetcher."esbuild-${pkgs.hostPlatform.system}";
in {
# simple imports, following the `deps.ts` convention
remote-simple = pkgs.denoPlatform.mkDenoDerivation {
name = "remote-simple";
src = ./examples/remote;
inherit buildPhase;
};
# with npm dependencies
npm-simple = pkgs.denoPlatform.mkDenoDerivation {
name = "npm-simple";
src = ./examples/npm-simple;
inherit buildPhase;
};
# with npm dependencies + custom registry
npm-simple-custom-npm-registry = pkgs.denoPlatform.mkDenoDerivation {
name = "npm-simple-custom-npm-registry";
src = ./examples/npm-simple;
npmRegistryUrl = "http://localhost:4873";
inherit buildPhase;
};
# with esm.sh dependencies
esm-simple = pkgs.denoPlatform.mkDenoDerivation {
name = "esm-simple";
src = ./examples/esm-simple;
inherit buildPhase;
};
# Fresh project heavily utilizing esm.sh dependencies
fresh = pkgs.denoPlatform.mkDenoDerivation {
name = "fresh";
src = ./examples/fresh;
buildPhase = ''
deno task build
'';
env.ESBUILD_BINARY_PATH = "${esbuild.src}/bin/esbuild";
installPhase = ''
cp -r _fresh $out
'';
};
# Lume project with mixed dependencies
lume = pkgs.denoPlatform.mkDenoDerivation {
name = "lume";
stdenv = pkgs.stdenvNoCC;
src = ./examples/lume;
buildPhase = ''
deno task build
'';
installPhase = ''
mkdir -p $out
cp -r _site/* $out
'';
};
cliffy-runtime = pkgs.denoPlatform.mkDenoPackage {
name = "cliffy-runtime";
src = ./examples/cliffy;
permissions.allow.all = true;
};
cliffy-binary = pkgs.denoPlatform.mkDenoBinary {
name = "cliffy";
src = ./examples/cliffy;
permissions.allow.net = "localhost:8080";
};
webview = pkgs.denoPlatform.mkDenoBinary {
name = "webview";
src = ./examples/webview;
permissions.allow = {
env = ["PLUGIN_URL" "DENO_DIR" "HOME"];
ffi = true;
net = ["127.0.0.1:8000"];
read = true;
write = true;
};
unstable = true;
include = ["worker.tsx"];
entryPoint = "main.ts";
};
}