forked from unionlabs/union
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsite.nix
More file actions
76 lines (74 loc) · 1.84 KB
/
Copy pathsite.nix
File metadata and controls
76 lines (74 loc) · 1.84 KB
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
_: {
perSystem =
{
pkgs,
lib,
mkCi,
pkgsUnstable,
ensureAtRepositoryRoot,
...
}:
let
deps = with pkgsUnstable; [
pkg-config
nodePackages_latest.nodejs
];
buildPnpmPackage = import ../tools/typescript/buildPnpmPackage.nix {
inherit lib pkgs;
};
in
{
packages = {
site = mkCi false (buildPnpmPackage {
hash = "sha256-XQJ+vbwVQz3lXnFzJ7X7FF7dq2Bt0d8IMDBkGl+NfuU=";
packageJsonPath = ./package.json;
extraSrcs = [
../site
];
nativeBuildInputs = deps;
buildInputs = deps;
buildPhase = ''
runHook preBuild
export PUPPETEER_SKIP_DOWNLOAD=1;
export ASTRO_TELEMETRY_DISABLED=1;
export NODE_OPTIONS="--no-warnings";
pnpm --filter=site build
runHook postBuild
'';
installPhase = ''
mkdir -p $out
cp -r ./site/.vercel/output/* $out
'';
doDist = false;
});
};
apps = {
site-dev-server = {
type = "app";
program = pkgs.writeShellApplication {
name = "site-dev-server";
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd site/
export PUPPETEER_SKIP_DOWNLOAD=1
npm install
npm run dev -- --host
'';
};
};
site-check = {
type = "app";
program = pkgs.writeShellApplication {
name = "site-check";
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd site/
npm_config_yes=true npx astro check
'';
};
};
};
};
}